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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Badger::Class also makes this easy (Score:1)
The code sample you posted is almost there. You just need to create an anonymous package name instead of using
__PACKAGE__. I would simply append the accessor names to the base class, e.g.Object::Anonymous_ding_wong_linesub new {
my $class = shift;
my %args = @_;
my $self = { };
my $name = join('_', $class, keys %args);
for my $arg (keys %args) {
Re:Badger::Class also makes this easy (Score:1)
The code sample you posted is almost there. You just need to create an anonymous package name instead
Ha! Who woulda' thunk? I wrote that example code off-the-cuff in an attempt to better explain what I wanted. But that's a simple enough change that I'm now tempted to start using it as-is. Any other issues you can think might be lurking in the code?
Reply to This
Parent
Re: (Score:1)
I guess some sanity checks on the attribute names would be a good idea...