Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Replace Hash-Ref with Array-Ref

by tobyink (Canon)
on Nov 08, 2012 at 09:05 UTC ( [id://1002844]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Data::Dumper;
    
    ...
    sub replace_ref {
        $_[0] = $_[0]{baz};
    }
    
  2. or download this
    use Data::Dumper;
    use Data::Swap;
    ...
    sub replace_ref {
        swap $_[0], $_[0]{baz};
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-03-28 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found