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

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;
Outputs:
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

    that list is not restricted to be a list of scalars

    Yes it is, as all lists are. You can't have a list of anything but scalars. In your example, grep returned two scalars, both of which are references.