in reply to Extract the odd and even columns seperately in the hash of arrays or some other data structure apart from arrays

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

  • Comment on Re: Extract the odd and even columns seperately in the hash of arrays or some other data structure apart from arrays
  • Download Code