Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How to export hash references

by hippo (Chancellor)
on Feb 14, 2020 at 12:05 UTC ( #11112961=note: print w/replies, xml ) Need Help??


in reply to How to export hash references

Package Foo;

This isn't valid. In Perl, package is all in lowercase.

Your actual problem (once that's fixed) is that you are not escaping the dollar symbol.

$ perl -I. -MFoo=$env -le 'print scalar keys %$env' 0 $ perl -I. -MFoo=\$env -le 'print scalar keys %$env' 76

Replies are listed 'Best First'.
Re^2: How to export hash references
by Anonymous Monk on Feb 14, 2020 at 12:32 UTC
    Thanks hippo. That Package thing was a dumb typo, good catch. I'm so used to importing arrays and hashes, without having to escape the sigil, that I forgot about the pesky $hell. Thank you!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2020-06-05 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (37 votes). Check out past polls.

    Notices?