in reply to Re^3: Problems with grep
in thread Problems with grep
That is not correct, as I said before grep returns a list, and that list is not restricted to be a list of scalars as you are claiming:
update: References are scalars, sorry for the confusion
Outputs:use strict; use warnings; use Data::Dumper; my @t = ( [1,2,3], 0, [4,5,6] ); my @k = grep { ref $_ eq "ARRAY" } @t; print Dumper \@k;
531(255)[1603][/home/pignatelli/tmp]$ perl kkk.pl $VAR1 = [ [ 1, 2, 3 ], [ 4, 5, 6 ] ];
citromatik
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Problems with grep
by ikegami (Patriarch) on Jan 30, 2009 at 15:31 UTC |