In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/fca02b3118d762ef634915ba3c68eddbf818a2b6?hp=958e98f0d5b0ac49e048e0f734715af7f86d3bd7>
- Log ----------------------------------------------------------------- commit fca02b3118d762ef634915ba3c68eddbf818a2b6 Author: Nicholas Clark <[email protected]> Date: Tue Jun 22 13:38:11 2010 +0100 Clarify the entry for "Stashes are now always defined". ----------------------------------------------------------------------- Summary of changes: pod/perl5132delta.pod | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pod/perl5132delta.pod b/pod/perl5132delta.pod index 56cce9e..eaaca09 100644 --- a/pod/perl5132delta.pod +++ b/pod/perl5132delta.pod @@ -33,8 +33,20 @@ this change (c1bd23). =head2 Stashes are now always defined -%stash:: is now autovivified so 'defined %Foo::' always returns true -- although calling defined on a stash is now deprecated. +C<defined %Foo::> now always returns true, even when no symbols have yet been +defined in that package. + +This is a side effect of removing a special case kludge in the tokeniser, +added for 5.10.0, to hide side effects of changes to the internal storage of +hashes that to drastically reduce their memory usage overhead. + +Calling defined on a stash has been deprecated since 5.6.0, warned on +lexicals since 5.6.0, and has warned for stashes (and other package +variables) since 5.12.0. C<defined %hash> has always exposed an +implementation detail - emptying a hash by deleting all entries from it does +not make C<defined %hash> false, hence C<defined %hash> is not valid code to +determine whether an arbitrary hash is empty. Instead, use the behaviour +that an empty <%hash> always returns false in a scalar context. =head1 Core Enhancements -- Perl5 Master Repository
