http://qs321.pair.com?node_id=11116854


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

Maybe something for the perldoc: keys must be valid Perl identifiers if accessed via this module.

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

Replies are listed 'Best First'.
Re^4: Converting Hashes to Objects
by haukex (Archbishop) on May 17, 2020 at 14:34 UTC
    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