Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Passing values in a hash to a subroutine:

by Elihu (Novice)
on Feb 02, 2000 at 03:34 UTC ( [id://2693]=note: print w/replies, xml ) Need Help??


in reply to Passing values in a hash to a subroutine:

I just tried throwing a shift statement before the chomp statement in the first sub replace block. And even though this has the effect of taking the first element of @_ and placing it in $_, the changes don't make it back to the hash.

After reading 'the gory details', I found that this is because @_ is an implicit reference to the actual scalar parameters, and therefore the modifications made upon @_ make it back to my hash. But if I shift the value into $_, any changes I make won't make it back to my hash.

Is this correct? Thanks for the help.

  • Comment on Re: Passing values in a hash to a subroutine:

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found