Is my (@args) = @_; equivalent to my @sargs = @_;?Yes it is
my $config = {"delete" => 0, soFiles =>[]};Technically $config is not a hash table but a reference to a hash
Is it right that $config is a hash table?
is these 2 lines are equivalent ?Yes they are.my $config = {"delete" => 0, soFiles => }; my $config = {"delete" => 0, "soFiles" => };
$config->{delete} = 1; # why -> is it a reference ?
Yes it is a reference
why not to use : $config{delete} = 1 ?Because it is a reference and writing it that way (ie $config{delete} will look for a structure named %config and create/modify a key named delete to 1 (depending on strict and if %config exists). The first way does the same to the hash which $config refers to.
-enlil
In reply to Re: Perl data types and references
by Enlil
in thread Perl data types and references
by thierry
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |