Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
Devel::Deprecate has just been uploaded to PAUSE. Basic usage:
use Devel::Deprecate 'deprecate';
sub name {
my ( $self ) = @_;
deprecate(
reason => 'Please use the set_name() method for setting names',
warn => '2008-11-01', # also accepts DateTime objects
die => '2009-01-01', # two month deprecation period
if => sub { return @_ > 1 },
);
if ( @_ > 1 ) {
$self->{name} = $_[1];
return $self;
}
return $self->{name};
}
Note that the deprecate function is designed to be a no-op unless you're running tests.
I also have to confess that though there's a touch of cruft, I'm particularly pleased with how the test suite came out on that.
Feature request! (Score:2)
Re: (Score:2)
Re: (Score:2)
Thank you. I'm quite happy with it myself :) I just hope it turns out to be as useful as it seems.
Re: (Score:2)
Can you show me the syntax you'd like to see for that? I think there's enough flexibility in it now, so I must be misunderstanding you.