Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
If I want to serialize arbitrary classes with Bermuda, I need to make arbitrary classes (and instances of them. I looked for something useful, but I'm not seeing it. Currently I'm writing the following:
ok my $dummy = Class::Dummy->new(
package => 'Foo::Bar',
methods => {
first_name => 'bob',
last_name => 'marley',
aref => [ 1,2,3 ],
list => sub { ( 3, 4, 5 ) },
full_name => sub {
my $self = shift;
return join ' ' => map { $self->$_ } qw/ first_name last_name/;
},
};
), '... creating a dummy class should succeed';
isa_ok $dummy, 'Class::Dummy', '... and the object it returns';
can_ok $dummy, 'first_name';
is $dummy->first_name, 'bob';
Please let me know if this already exists.
Inner classes! (Score:2)
You could nearly call that Class::Inner and have it work like Java's inner classes :)
Which IMO might be a useful thing. Inner classes definitely have their uses - maybe more so in Java.
Re: (Score:2)
I was thinking of this more as a testing tool so that I could generate fixtures on the fly and embed them in tests:
A persistent problem with test suites is having fixtures embedded in files and the poor programmer has to pop between several files to see them. That also means that a change to one fixture possibly means
Re: (Score:2)
Sorry - being terse today :)
I realised what it was for but it occurred to me that it might sometimes be useful outside of tests.
Re: (Score:2)
Maybe I should rename it then? It really does seem like a useful testing tool (it's already making my life easier), but perhaps others could use it. Does Class::Temp sound like a good name? It would be very useful when you find yourself passing around hashrefs but you hate locked hashes.
Re: (Score:2)
Re: (Score:2)
And along the lines of what I said earlier, here's my first test case with it:
some options (Score:1)
http://groups.google.com/group/perl.perl5.porters/msg/b05428a97a7a91e4 [google.com]
rjbs
Re: (Score:2)
Ah, that looks pretty interesting!
Package::FromData (Score:1)