Perl Parentheses

Oh man,

In Perl, you use () to declare a list like this:

my @array = (0);
my %hash = ('name' => 'Arvid');

Then when you want to access you have to use [] or {}:

my $array_val = $array[0];
my $name = $hash{'name'};

Just nutty syntax folks.

Comments

Popular Posts