in reply to Lost in doc
After the second, @arr contains three elements. After the first, @arr contains one element, which would be an arrayref.
#!/usr/bin/perl -w use strict; use Data::Dumper; my @a = [ qw(a b c) ]; print "\@a contains ",scalar @a," element(s) and looks as such:$/",Dum +per(\@a); my @b = ( qw(a b c) ); print "\@b contains ",scalar @b," element(s) and looks as such:$/",Dum +per(\@b); __DATA__ output: @a contains 1 element(s) and looks as such: $VAR1 = [ [ 'a', 'b', 'c' ] ]; @b contains 3 element(s) and looks as such: $VAR1 = [ 'a', 'b', 'c' ];
Some places to look: perldata, perldsc, perllol, and qw. Hope this helps.
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
|
|---|