in reply to Re^2: split every other value
in thread split every other value
I don't understand the point of the third arrayref. I also find it easier on the eyes with a foreach, but to each his own.
my ( @evens, @odds ); my @all = ( \@even, \@odd ); push @{ $all[ $_ % 2 ] }, $_ for split /,/, $scalar;
Brevity, but don't do this at home: you can combine the first two lines into
my @all = \my ( @evens, @odds );
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: split every other value
by Prior Nacre V (Hermit) on Aug 07, 2004 at 01:56 UTC |