Re: nested loop

2008-10-27 Thread Rob Dixon
Adams Paul wrote: > Hello everyone, > I have a program which navigates to a page and then extracts the links and > navigates > to each of those links.It works fine for the first web page(the program > navigates to > the first page and then extracts the links and visits all the links).When I > th

Re: Nested loop

2007-04-21 Thread Dr.Ruud
"Chas Owens" schreef: > Dr.Ruud: >> Chas Owens: >>> But Synopsis 4* says >>>There is no foreach statement any more. It's always spelled >>> for in Perl 6, >>>so it always takes a list as an argument >> >> Well Perl6 isn't Perl, it's a successor to Perl. Like Perl did, Perl6 >> took

Re: Nested loop

2007-04-21 Thread Chas Owens
On 4/21/07, Dr.Ruud <[EMAIL PROTECTED]> wrote: "Chas Owens" schreef: > But Synopsis 4* says >There is no foreach statement any more. It's always spelled for > in Perl 6, >so it always takes a list as an argument Well Perl6 isn't Perl, it's a successor to Perl. Like Perl did, Per

Re: Nested loop

2007-04-21 Thread Dr.Ruud
"Chas Owens" schreef: > But Synopsis 4* says >There is no foreach statement any more. It's always spelled for > in Perl 6, >so it always takes a list as an argument Well Perl6 isn't Perl, it's a successor to Perl. Like Perl did, Perl6 took a lot of good parts out of other language

Re: Nested loop

2007-04-20 Thread Chas Owens
On 4/20/07, Paul Johnson <[EMAIL PROTECTED]> wrote: snip > The grep clearly states that I am looking for something and its block > tells me what the criteria are. There are times where this list needs webctams. I'd love to have been able to have seen you as you wrote that since I find it hard t

Re: Nested loop

2007-04-20 Thread Chas Owens
On 4/20/07, oryann9 <[EMAIL PROTECTED]> wrote: snip So will foreach really be going away? snip If Synopsis 4* is to be believed, in Perl 6 there will not be a loop named foreach. There will be a loop named for that does the has all of the functionality of foreach (just like in Perl 5). Also t

Re: Nested loop

2007-04-20 Thread Paul Johnson
On Fri, Apr 20, 2007 at 01:47:18PM -0400, Chas Owens wrote: > but you > should be more concerned with making what you write clearly express > your intent. This is why I prefer > > my @a = (0 .. 10); > my $i = 0; > for my $elem (grep {

Re: Nested loop

2007-04-20 Thread oryann9
--- Chas Owens <[EMAIL PROTECTED]> wrote: > On 4/20/07, John W. Krahn <[EMAIL PROTECTED]> wrote: > snip > > You are omitting one critical argument. For > people who are stuck with older > > versions of Perl and in your grep() example above > the foreach expression > > creates its list in memory w

Re: Nested loop

2007-04-20 Thread Chas Owens
On 4/20/07, John W. Krahn <[EMAIL PROTECTED]> wrote: snip You are omitting one critical argument. For people who are stuck with older versions of Perl and in your grep() example above the foreach expression creates its list in memory which may cause the program to die if the list is large enough

Re: Nested loop

2007-04-20 Thread John W. Krahn
Chas Owens wrote: > On 4/20/07, yitzle <[EMAIL PROTECTED]> wrote: >> There's been mentions of efficiency. >> I'm under the impression that for the uses Perl is put to, the >> efficiency of a loop is sorta irrelevent. If you are doing >> harddrive/network access, the performance gain of one loop ove

Re: Nested loop

2007-04-20 Thread Chas Owens
On 4/20/07, John W. Krahn <[EMAIL PROTECTED]> wrote: snip I see nothing about backwards compatibility in there? ;-) snip Nope, I could not find any proof. I did find a merlyn quote on perlmonks that states for and foreach have always been aliased, but that is not how I remember it. But who a

Re: Nested loop

2007-04-20 Thread Chas Owens
On 4/20/07, yitzle <[EMAIL PROTECTED]> wrote: There's been mentions of efficiency. I'm under the impression that for the uses Perl is put to, the efficiency of a loop is sorta irrelevent. If you are doing harddrive/network access, the performance gain of one loop over the other is more of less in

Re: Nested loop

2007-04-20 Thread John W. Krahn
yitzle wrote: > There's been mentions of efficiency. > I'm under the impression that for the uses Perl is put to, the > efficiency of a loop is sorta irrelevent. If you are doing > harddrive/network access, the performance gain of one loop over the > other is more of less invisible. > Come to think

Re: Nested loop

2007-04-20 Thread John W. Krahn
Chas Owens wrote: > On 4/19/07, John W. Krahn <[EMAIL PROTECTED]> wrote: >> Chas Owens wrote: >> > Yes, foreach was aliased to for for backwards compatibility, >> >> Huh? Do you have something to back up that claim? > > Well, perlsyn* says > The "foreach" keyword is actually a synonym for t

Re: Nested loop

2007-04-20 Thread yitzle
There's been mentions of efficiency. I'm under the impression that for the uses Perl is put to, the efficiency of a loop is sorta irrelevent. If you are doing harddrive/network access, the performance gain of one loop over the other is more of less invisible. Come to think of it, the time for inte

Re: Nested loop

2007-04-20 Thread oryann9
--- Chas Owens <[EMAIL PROTECTED]> wrote: > On 4/19/07, John W. Krahn <[EMAIL PROTECTED]> wrote: > > Chas Owens wrote: > > > Yes, foreach was aliased to for for backwards > compatibility, > > > > Huh? Do you have something to back up that claim? > > Well, perlsyn* says >The "foreach" key

Re: Nested loop

2007-04-19 Thread Chas Owens
On 4/19/07, Rob Dixon <[EMAIL PROTECTED]> wrote: snip for (my $elem = $doc->firstChild; $elem; $elem = $elem->nextSibling) { : } snip I covered that in my earlier email: Weirder stuff that you only tend to see people coming from a C background do for (my $node = $head; $node;$node = $no

Re: Nested loop

2007-04-19 Thread Chas Owens
On 4/19/07, John W. Krahn <[EMAIL PROTECTED]> wrote: Chas Owens wrote: > Yes, foreach was aliased to for for backwards compatibility, Huh? Do you have something to back up that claim? Well, perlsyn* says The "foreach" keyword is actually a synonym for the "for" keyword, so you can

Re: Nested loop

2007-04-19 Thread Rob Dixon
John W. Krahn wrote: Chas Owens wrote: On 4/19/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: From: "Chas Owens" <[EMAIL PROTECTED]> foreach is dead, long live for. I would myself use "for" for the C-style loops And this is why. As long as people think "well, I have foreach which is fo

Re: Nested loop

2007-04-19 Thread John W. Krahn
Chas Owens wrote: > On 4/19/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: >> From: "Chas Owens" <[EMAIL PROTECTED]> > snip >> > foreach is dead, long live for. >> >> William is dead, long live Bill? >> >> foreach and for are two names for the same thing and just as you can >> call someone both Will

Re: Nested loop

2007-04-19 Thread Jeni Zundel
foreach is dead? dangit... I loved that. and, java 5 just put in a for loop construct that is very similar to the foreach. jen On Thursday, April 19, 2007, at 08:08AM, "Chas Owens" <[EMAIL PROTECTED]> wrote: >On 4/19/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: >> From: "Chas Owens" <[EMAIL

Re: Nested loop

2007-04-19 Thread Chas Owens
On 4/19/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: From: "Chas Owens" <[EMAIL PROTECTED]> snip > foreach is dead, long live for. William is dead, long live Bill? foreach and for are two names for the same thing and just as you can call someone both William and Bill you can use foreach and

Re: Nested loop

2007-04-19 Thread Jenda Krynicky
From: "Chas Owens" <[EMAIL PROTECTED]> > On 4/18/07, yitzle <[EMAIL PROTECTED]> wrote: > > I got an array of hashes so I am using a foreach (@arr) loop to access > > the hashes. > > How do I go about looping through the hash's keys/values? I was > > thinking of another foreach, but then the $_ gets

Re: Nested loop

2007-04-19 Thread Dr.Ruud
"Chas Owens" schreef: > foreach is dead, long live for. I am in favor of burying foreach as well, bu I see that many people still like to use "for" for the C-style construct, and foreach for the "other one". -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: Nested loop

2007-04-18 Thread Tom Phoenix
On 4/18/07, yitzle <[EMAIL PROTECTED]> wrote: I got an array of hashes so I am using a foreach (@arr) loop to access the hashes. How do I go about looping through the hash's keys/values? I was thinking of another foreach, but then the $_ gets a bit screwed up... Do I need to do this ? foreach(@

Re: Nested loop

2007-04-18 Thread Chas Owens
On 4/18/07, yitzle <[EMAIL PROTECTED]> wrote: I got an array of hashes so I am using a foreach (@arr) loop to access the hashes. How do I go about looping through the hash's keys/values? I was thinking of another foreach, but then the $_ gets a bit screwed up... Do I need to do this ? foreach(@a

Re: Nested Loop

2006-01-19 Thread mgoland
- Original Message - From: [EMAIL PROTECTED] Date: Thursday, January 19, 2006 3:19 pm Subject: Nested Loop > Greetings, Hello > > Basically I deleted a portion of a mysql database and need to > insert the > subnet back in. The output is suppose to increment the first > field > star