develooper Front page | perl.perl5.porters | Postings from February 2009

Re: deprecating

Thread Previous | Thread Next
Michael G Schwern
February 25, 2009 13:25
Re: deprecating
Message ID:
Nicholas Clark wrote:
> Well, basically, I didn't think of writing it on one line. :-)
> I was thinking
> use deprecated if $] >= 5.11;
> then "oh crap, that seems to be a syntax error" and then thought that writing
> it all out longhand would be a big intrusion on the code of each module we
> want to deprecate.
> However, I'm coming round to the view that your one liner is possibly better
> than, despite existing for just this.

If this is going to be a common enough use case for deprecated, conditional
deprecation, why not build it in?

    use deprecated $] >= 5.11;

Or to leave open the possibility of other arguments...

    use deprecated if => $] >= 5.11;

151. The proper way to report to my Commander is "Specialist Schwarz,
     reporting as ordered, Sir" not "You can't prove a thing!"
    -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About