in reply to Re: Re: Re: foreach/map equivalency
in thread foreach/map equivalency
That doesn't mean you can't use a push, just that you don't have to to make one list:my @times_two = map { $_ * 2 } (1 .. 12);
my @duplicate; my @times_two = map { my $val = $_ * 2; push @duplicate, $_; $_ } (1 . +. 12);
Does that make it clearer?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: foreach/map equivalency
by gloryhack (Deacon) on Nov 12, 2001 at 10:20 UTC | |
by chromatic (Archbishop) on Nov 12, 2001 at 23:22 UTC |