in reply to passing array ref without variable
Yes, just try it – and see what happens with Data::Dumper or any of its ilk. (Also nice to use strictures and warnings!)
>perl -wMstrict -le "use Data::Dumper; my %hash = qw(a 1 b 2 c 3 d 4); my_function([keys %hash]); sub my_function { my $arr_ref = shift; print Dumper $arr_ref; } " $VAR1 = [ 'c', 'a', 'b', 'd' ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: passing array ref without variable
by vit (Friar) on May 03, 2010 at 15:23 UTC | |
by kennethk (Abbot) on May 03, 2010 at 16:05 UTC | |
by LanX (Saint) on May 03, 2010 at 17:03 UTC | |
by vit (Friar) on May 03, 2010 at 21:07 UTC | |
by FunkyMonk (Bishop) on May 03, 2010 at 21:15 UTC | |
by LanX (Saint) on May 03, 2010 at 21:26 UTC | |
by Anonymous Monk on May 04, 2010 at 00:50 UTC | |
| |
by AnomalousMonk (Archbishop) on May 03, 2010 at 16:15 UTC |