develooper Front page | perl.perl5.porters | Postings from August 2013

'Variable "$foo" is not available since ce0d59fdd1c

Thread Next
From:
Dave Mitchell
Date:
August 22, 2013 12:24
Subject:
'Variable "$foo" is not available since ce0d59fdd1c
Message ID:
20130822122432.GZ2177@iabyn.com

This code (and similar code in various test files in the test suite):

    use warnings;
    my $x;
    our $y;
    sub { $x = $y }->();

has started giving this spurious warning:

    Variable "$y" is not available at /tmp/foo line 4.

since this commit:

commit ce0d59fdd1c7d145efdf6bf8da56a259fed483e4
Author: Father Chrysostomos <sprout@cpan.org>
Date:   Tue Jul 2 13:07:45 2013 -0700

    [perl #7508] Use NULL for nonexistent array elems
    
    This commit fixes bug #7508 and provides the groundwork for fixing
    several other bugs.
    
    Elements of @_ are aliased to the arguments, so that \$_[0] within
    sub foo will reference the same scalar as \$x if the sub is called
    as foo($x).
    
    &PL_sv_undef (the global read-only undef scalar returned by the
    ‘undef’ operator itself) was being used to represent nonexistent
    array elements.  So the pattern would be broken for foo(undef), where
    \$_[0] would vivify a new $_[0] element, treating it as having been
    nonexistent.
    
    This also causes other problems with constants under ithreads
    (#105906) and causes a pending fix for another bug (#118691) to trig-
    ger this bug.
    
    This commit changes the internals to use a null pointer to represent a
    nonexistent element.
    
    This requires that Storable be changed to account for it.  Also,
    IPC::Open3 was relying on the bug.  So this commit patches
    both modules.


-- 
Atheism is a religion like not collecting stamps is a hobby

Thread Next


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