glwtta has asked for the wisdom of the Perl Monks concerning the following question:
I've recently come across this slightly odd (at least it seems so to me) construct: foreach my $line(<INFILE>){} # assume INFILE is open and I am a little curious - is this completely analagous to while (my $line = <INFILE>){} or is there some subtle difference? (in terms of efficiency)
Please shed the light of wisdom on this monk, unfamiliar with the mysteries of perl's inner workings.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: foreach question
by hv (Prior) on Feb 25, 2003 at 02:19 UTC | |
|
Re: foreach question
by Zaxo (Archbishop) on Feb 25, 2003 at 02:20 UTC | |
by glwtta (Hermit) on Feb 25, 2003 at 02:56 UTC | |
by BigLug (Chaplain) on Feb 25, 2003 at 04:46 UTC | |
|
Re: foreach question
by OM_Zen (Scribe) on Feb 25, 2003 at 03:24 UTC |