--- 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 which may cause the
> program to die if the list is
> > large enough while the C style for loop does not
> have this problem.
> snip
>
> I refuse to let the fact that some people
> cannot/will not upgrade
> their copy of Perl affect how I code or advise
> others to code. There
> are still people who wrtie/maintain Perl4 scripts,
> should I not tell
> people to use the strict pragma? Even IBM is
> shipping a modern Perl
> with AIX now.
>
I agree with Chas and can support the AIX notion as I
work on AIX 5.3 machines which is the latest AIX.
But I did not see any response about:
Interesting though I ran perl -MO=Deparse on this
code...
So will foreach really be going away?
$ cat foo1
for my $i (0 .. 3) {
$i *= 3;
print $i,"\n";
}
print "\n\n";
for my $i (map { $_ * 3 } 0 .. 3) {
print "$i\n";
}
$ perl -MO=Deparse foo1
foreach my $i (0 .. 3) {
$i *= 3;
print $i, "\n";
}
print "\n\n";
foreach my $i (map {$_ * 3;} 0..3) {
print "$i\n";
}
foo1 syntax OK
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/