Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I decided to go ahead and write this, because I'm doing a fair amount of glob munging in WWW::Mechanize::Pluggable, and it'd be nice to have it better encapsulated. It does what you asked it to do in your example, and it's available on CPAN.

    As a nice bonus, I got a chance to try the inside-out object model and Class::Std. Found it much easier to concentrate on getting the details of the glob manipulation right because I knew that the object access code was safe.

    I did find one thing I needed to do that wasn't simple with Class::Std. As you noted, removing a symbol table entry safely consists of deleting the glob altogether, then inserting the fields you want to keep back into the glob again. A Class::Std class doesn't let you iterate over all of the fields in the object easily, because they aren't *in* the object. I ended up creating a mapping hash that mapped method names to the storage hashes to be able to find them all easily.