[Bioperl-l] use warnings

Aaron J Mackey ajm6q at virginia.edu
Wed Mar 26 07:57:23 EST 2003


I noticed in the breeze of fixups from Heikki that a few of them were
replacements of the -w flag with use warnings.  I like "use warnings" but
there is an issue with older perls.  I've copied a recent posting on
perl5-porters about possible solutions that will work with older perls:


---------- Forwarded message ----------
Date: 26 Mar 2003 10:01:57 +0100
From: Slaven Rezic <slaven at rezic.de>
To: Nicholas Clark <nick at unfortu.net>
Cc: perl5-porters at perl.org, Simon Wistow <simon at thegestalt.org>
Subject: Re: PREREQ_PM => { warnings => 0 }

Nicholas Clark <nick at unfortu.net> writes:

> Following a thread on the london.pm list:
>
> On Wed, Mar 19, 2003 at 10:54:28AM +0000, Simon Wistow wrote:
> > Could somebody release warnings to CPAN as a standalone (even if it was
> > effectively a no-op if v < 5.6) and then people could remove the require
> > perl.5.6.0 from their code?
>
> I think that this idea is worthy of discussion. What would be wrong with
> releasing a dummy warnings module to CPAN, so that putting use warnings;
> in a module doesn't also mandate require 5.006; ?
>
> People like use warnings; but often it's about the only think that forces
> the minimum perl version required up to 5.6. If this could be made to work
> then people can have their cake and eat it.

You could already use the if.pm module:

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

> I think I can see one problem - warnings.pm in 5.6.0 has no $VERSION
> But is that a fatal flaw?
>

Regards,
	Slaven

-- 
Slaven Rezic - slaven at rezic.de

    tksm - Perl/Tk program for searching and replacing in multiple files
    http://ptktools.sourceforge.net/#tksm



More information about the Bioperl-l mailing list