develooper Front page | perl.perl5.porters | Postings from September 2000

[PATCH 5.6.0@6962] perldelta

Paul Marquess
September 1, 2000 06:02
[PATCH 5.6.0@6962] perldelta
Message ID:
Not sure where to fit this into perldelta, but it documents the changes to
the warnings pragma.

=head2 warnings pragma

=over 4

=item *

A convenience function, C<warnings::warnif>, has been added to the pragma.
It is the equivalent to:

    if ( warnings::enabled(...) )
      { warnings::warn(...) }

=item *

In 5.6.0 both C<warnings::enabled> and C<warnings::warn> only checked
the setting for the warnings bitmask in the scope one level up the caller
stack. This behaviour has been modified so that the scope checked will be
the first found in the caller stack where the package name is different
from the current scope.

=item *

All three C<warnings::*> functions can now optionally take an object
reference in place of a warnings category. In this case the warnings
category used will be the class name of the object reference. Also the
scope used to check the warnings bitmask will be the furthest up the
caller stack that the object was used.

=item *

Fixed a nasty scoping bug that sneaked into 5.6.0 at the last moment. In
the code below, 5.6.0 wasn't triggering the FATAL warning. This has
been fixed.

    use warnings ;
    time ;
        use warnings FATAL => 'void';
        time ;
    time ;


Do You Yahoo!?
Get your free address at Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About