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

[PATCH 5.6.0@6962] perldelta

From:
Paul Marquess
Date:
September 1, 2000 06:02
Subject:
[PATCH 5.6.0@6962] perldelta
Message ID:
001b01c01414$d6125140$a20a140a@bfs.phone.com
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 ;

=back


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About