Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: Converting Hashes to Objects

by haukex (Bishop)
on May 17, 2020 at 14:34 UTC ( #11116856=note: print w/replies, xml ) Need Help??


in reply to Re^3: Converting Hashes to Objects
in thread Converting Hashes to Objects

keys must be valid Perl identifiers if accessed via this module.

Good point, thanks, done.

Other methods can still be called with trickery, but of course that's not really the point of this module :-)

use Util::H2O; my $o = h2o { '$%@.?' => 123 }; my $meth = '$%@.?'; print $o->$meth; # prints 123

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2020-09-26 13:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (141 votes). Check out past polls.

    Notices?