Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Modify a hash via its reference

by Errto (Vicar)
on Jan 23, 2008 at 22:51 UTC ( #663905=note: print w/ replies, xml ) Need Help??


in reply to Re: Modify a hash via its reference
in thread Modify a hash via its reference

No need for the "()" around a single my variable declaration
This is true in most situations but not all. From the OP's code:
my ( $Ref_to_Hash ) = @_;
In this style of parameter initialization, the parentheses are in fact required. Otherwise $Ref_to_Hash will be assigned the number of arguments, not the value of the first one.


Comment on Re^2: Modify a hash via its reference
Download Code
Replies are listed 'Best First'.
Re^3: Modify a hash via its reference
by bradcathey (Prior) on Jan 24, 2008 at 03:26 UTC

    I stand corrected (which is why I love this place). Thanks, I learned something.

    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://663905]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2015-07-29 06:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls