Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
sub marine($string, \%hash)
The line that I do not understand is my(%hash) = %{(shift)};. Why there are parenthesis there? Could you please explain this?sub marine { my $line = shift; my(%hash) = %{(shift)}; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash to sub
by toolic (Bishop) on Feb 27, 2012 at 14:58 UTC | |
|
Re: hash to sub
by JavaFan (Canon) on Feb 27, 2012 at 14:56 UTC | |
|
Re: hash to sub
by wwe (Friar) on Feb 27, 2012 at 16:04 UTC | |
|
Re: hash to sub
by Anonymous Monk on Feb 27, 2012 at 15:39 UTC | |
|
Re: hash to sub
by Marshall (Canon) on Feb 28, 2012 at 13:12 UTC |