Something like this may do what you want.
$ perl -E ' > @arr = ( 0 .. 9 ); > say qq{@arr}; > push @{ $_ % 2 ? \ @odd : \ @even }, $arr[ $_ ] > for 0 .. $#arr; > say qq{@even\n@odd};' 0 1 2 3 4 5 6 7 8 9 0 2 4 6 8 1 3 5 7 9 $
I hope this is helpful.
Cheers,
JohnGG
|
|---|