close($undef) should not croak_no_modify
authorFather Chrysostomos <sprout@cpan.org>
Tue, 23 Aug 2011 21:36:46 +0000 (14:36 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 23 Aug 2011 21:36:46 +0000 (14:36 -0700)
commitce74145d973236b7a56fe8a090468f4c688c9062
tree4dada5041d8537b9ad89701a2a67d7cc473d4ad2
parented996e63f61a7ee2456fa3c26c7ab5d12fae3e1e
close($undef) should not croak_no_modify

Commit ac53db4c3f7e fixed bug #31767 (open $1 not dying), but put the
SvREADONLY check in the wrong spot, causing this bug:

$ perl -lwe 'no warnings "once"; close $x; close $+'
Name "main::x" used only once: possible typo at -e line 1.
Use of uninitialized value $x in ref-to-glob cast at -e line 1.
Modification of a read-only value attempted at -e line 1.

It shouldn’t be dying if I’m not trying to modifying it.
pp.c
t/io/open.t