in reply to Re: Re: "foreach" is to "next" as "map" is to ???
in thread "foreach" is to "next" as "map" is to ???
In the same way that the original foreach using next does not evaluate the push for every iteration, your code using push/unless does not evaluate the push every iteration.my @odds; for ( 0 .. 10 ) { push @odds => $_ % 2 ? $_ : (); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: "foreach" is to "next" as "map" is to ???
by Limbic~Region (Chancellor) on May 26, 2004 at 16:50 UTC | |
by Abigail-II (Bishop) on May 26, 2004 at 16:53 UTC | |
by sacked (Hermit) on May 26, 2004 at 16:57 UTC |