Say it with me:
{ 'hashes', 'are', 'curly', 'ones' }
[ 'arrays', 'are', 'square' ]
( 'lists are round' )
using and understanding strict/warnings cuts your development time in half!
#!/usr/bin/perl -- use strict;use warnings; use Data::Dump qw/ dd /; my %ro = { ( 1 => "j", 2 => "b", ), ( 1 => "p", 2 => "b", ), }; my %sham = ( ( 1 => "j", 2 => "b", ), ( 1 => "p", 2 => "b", ), ); my %bo = { { 1 => "j", 2 => "b", }, { 1 => "p", 2 => "b", }, }; dd \%ro; dd \%sham; dd \%bo; __END__ Reference found where even-sized list expected at - line 4. Reference found where even-sized list expected at - line 28. { "HASH(0x3f8c64)" => undef } { 1 => "p", 2 => "b" } { "HASH(0x99a3bc)" => undef }
In reply to Re: Difference in Hash Declaration
by Anonymous Monk
in thread Difference in Hash Declaration
by perl@1983
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |