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

Re: deprecating Switch.pm

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
February 25, 2009 13:25
Subject:
Re: deprecating Switch.pm
Message ID:
49A5B74E.9050005@pobox.com
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 if.pm, despite if.pm 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
           http://skippyslist.com/list/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About