Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

schwern (1528)

  (email not shown publicly)
AOL IM: MichaelSchwern (Add Buddy, Send Message)

Schwern can destroy CPAN at his whim.

Journal of schwern (1528)

Monday July 02, 2007
04:48 PM

Handy module: warnings::compat

[ #33664 ]

If you're like me, and I hope you aren't, you have this strange compulsion to maintain compatibility with Perl 5.5. One of the most common problems backporting to 5.5 is it does not have "use warnings". You have to replace "use warnings" or "no warnings" with clunky things like "local $^W = 0". Annoying.

warnings::compat is a handy little module which installs a and warnings::register on older perls. It fakes up as much of the warnings interface as it can, including the functions. The major shortcoming is that it cannot be lexical and ignores warning groups (ie. "use warnings 'redefine'" just turns on warnings). For most uses of warnings this is fine and it does its job.

Since it will quietly install nothing on modern perls, its safe to include a dependency on warnings::compat in your CPAN module.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.