Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Passing values in a hash to a subroutine:

by Elihu (Novice)
on Feb 02, 2000 at 03:34 UTC ( #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? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2022-01-23 18:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (64 votes). Check out past polls.

    Notices?