in reply to Re: Converting Hashes to Objects
in thread Converting Hashes to Objects
does this differ from Hash::AsObject
Yes, since that uses AUTOLOAD, which means it doesn't provide full typo prevention:
use Hash::AsObject; my $h = Hash::AsObject->new( foo => "bar" ); print $h->fOo, "\n"; # warning about undef use Util::H2O; my $o = h2o { foo => "bar" }; print $o->fOo, "\n"; # dies
Plus Util::H2O has the extra goodies like custom methods that I wrote about.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Converting Hashes to Objects
by 1nickt (Canon) on May 17, 2020 at 16:39 UTC |
In Section
Meditations