develooper Front page | perl.perl5.porters | Postings from July 2003

Re: Warnings.pm ?

Thread Previous | Thread Next
From:
slaven
Date:
July 29, 2003 05:27
Subject:
Re: Warnings.pm ?
Message ID:
1059474109.26962@devpc01.iconmobile.de
Elizabeth Mattijsen <liz@dijkmat.nl> wrote:
> I was thinking of putting the following code (courtesy PodMaster on PerlMonks):
> 
> BEGIN {
>      eval { require warnings } or do {
>          no strict 'refs';
>          *warnings::import = *warnings::unimport = sub{};
>          $INC{'warnings.pm'}='';
>      }
> } #BEGIN
> 
> as a Warnings.pm (note the capital 'W') module on CPAN.  This would 
> allow module authors to use Warnings; in modules that are supposed to 
> be able to run pre 5.6.
> 
> Would that interfere with any other plans we have?  Or would it 
> simplify matters?
> 

As an alternative one can do:

    use if $] >= 5.006, "warnings";

if.pm should be compatible with older perls and is included since 5.8.0

Regards,
    Slaven

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