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 brx (Pilgrim)
on Nov 08, 2012 at 09:02 UTC ( #1002843=note: print w/replies, xml ) Need Help??


in reply to Replace Hash-Ref with Array-Ref

I want that at the end $ref contains a reference to $ref->{baz}.

use Data::Dumper; my $ref = { "baz" => [1,2,3,4] }; print Dumper $ref; sub bazify {return $_[0]->{baz} }; $ref = bazify($ref); print Dumper $ref;

update: note that it is not a reference to $ref->{baz}, but its value (which is a ref to an anonymous array)

English is not my mother tongue.
Les tongues de ma mère sont "made in France".

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002843]
help
Chatterbox?
[Corion]: Hmmm. Maybe setting $ENV{PERL5LIB}=" some path without dot"; perl Makefile.PL; make test already is enough to locally test your module...
[Corion]: Meh, no, will need a BEGIN hook...
[Corion]: ... and PERL5OPT does not like -e in it :-(
[Corion]: Ah. The magic invocation is set PERL5OPT=-M-lib=. (equivalent of no lib '.';
[Corion]: )

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2017-03-27 08:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (317 votes). Check out past polls.