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
In reply to Re^4: Converting Hashes to Objects
by haukex
in thread Converting Hashes to Objects
by haukex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |