This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update perlguts for NULL in AVs
authorFather Chrysostomos <sprout@cpan.org>
Thu, 5 Sep 2013 07:03:32 +0000 (00:03 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 5 Sep 2013 12:59:10 +0000 (05:59 -0700)
pod/perlguts.pod

index ac9224c..95ed148 100644 (file)
@@ -534,12 +534,14 @@ is equivalent to this Perl code:
     my @av;
     $av[0] = undef;
 
-Unfortunately, this isn't true. AVs use C<&PL_sv_undef> as a marker
+Unfortunately, this isn't true.  In perl 5.18 and earlier, AVs use C<&PL_sv_undef> as a marker
 for indicating that an array element has not yet been initialized.
 Thus, C<exists $av[0]> would be true for the above Perl code, but
-false for the array generated by the XS code.
+false for the array generated by the XS code.  In perl 5.20, storing
+&PL_sv_undef will create a read-only element, because the scalar
+&PL_sv_undef itself is stored, not a copy.
 
-Other problems can occur when storing C<&PL_sv_undef> in HVs:
+Similar problems can occur when storing C<&PL_sv_undef> in HVs:
 
     hv_store( hv, "key", 3, &PL_sv_undef, 0 );