Undervalued Modules: Hash::AsObject

Ovid on 2004-08-18T18:21:54

There are plenty of modules out there that receive scant attention, perhaps because people don't understand them or, worse, because the authors are unknown (would anyone use Quantum::Superpositions if it wasn't written by Him?)

Today my nomination for an underappreciated module is Hash::AsObject. If all you need to do is present an appropriate interface, it's great.

my $faux_object = Hash::AsObject->new(theater_no => 123);
print $faux_object->theater_no;


Rating?

jplindstrom on 2004-08-18T18:43:11

A good way of making good modules used is to rate them IMHO.

In addition to raving about them in a blog entry of course :)

Re:Rating?

Ovid on 2004-08-18T18:47:39

Duh. I feel stupid now :)

No lvalue subs

djberg96 on 2004-08-18T20:26:51

Hm...this module looks like a prime candidate for using lvalue subs. Consider, I can do:
$h->{foo} = 123;
But I can't do this:
$h->foo = 123;
Right now it kinda feels like two different forms of syntax. I haven't looked at the source yet to see if this is problematic, or if the author simply hasn't added that feature yet. Perhaps I'll make a feature request. :)

Re:No lvalue subs

runrig on 2004-08-18T22:28:13

I made my own version at perlmonks because I wanted a semi-secure hash and so needed to bless each unique set of keys into a separate class. And I also handle lvalue subs :-) And I also added this functionality to my Parse::FixedLength module.