in reply to
slicing array based on values but not index
my @arr1 = grep {$_->[2]==30} @arr;
is one way of accomplishing something like this.
Comment on
Re: slicing array based on values but not index
Download
Code
Replies are listed 'Best First'.
Re^2: slicing array based on values but not index
by
suggestsome
(Initiate)
on Aug 13, 2009 at 22:02 UTC
but that will not give remaining output where $_->
2
==40 or 50. And this requires to know all the values column3 can have.
[reply]
Re^3: slicing array based on values but not index
by
ssandv
(Hermit)
on Aug 13, 2009 at 22:12 UTC
grep
is mighty helpful.
If you can't figure out how to get all the values column 3 has, you have bigger issues, since this clearly shows how to get the value in column 3. Perlmonks isn't here to do your work for you. You need to put some of your own effort in.
[reply]
In Section
Seekers of Perl Wisdom