in reply to Difference in Hash Declaration
The difference is that Example 2 (using parentheses) is correct and the others are broken.
Braces (i.e. { and }) are used (amongst other things) to create hash references. So...
my %hash = ( foo => 1, bar => 2 ); my $hashref = { foo => 1, bar => 2 };
|
---|