rrwo has asked for the wisdom of the Perl Monks concerning the following question:

So I distribute a module that uses warnings::register and have the possibly mistaken belief that it works with Perl 5.005.

Just got an E-mail from somebody that they get an error:

Can't locate warnings/register.pm in @INC

So is my assumption wrong? Can warnings.pm be updated for older versions of Perl?

Replies are listed 'Best First'.
Re: warnings::register and Perl 5.005?
by dchetlin (Friar) on Dec 14, 2000 at 06:10 UTC
    The warnings framework is new in 5.6.0, so anything that uses it is non-backportable.

    And there is no way I can possibly think of to make it work for < 5.6. warnings (as most pragmas) is an internal framework -- if you look at warnings.pm and warnings/register.pm, you'll see that all they do is set some bits and variables. perl itself has to do the checking of those things. perl binary 5.005 and back don't do that checking.

    Sorry :-(.

    Update: Oops. Put a bare < in the second paragraph, which kinda messed up what it was supposed to say. All good now.

    -dlc