perl -wE 'local $^O = $^O; die "oops" unless defined $^O; say "IT IS
$^O";'
dies because the localized $^O is undef. Doing local $^O = $^O."";
avoids the problem
(Why would anyone do that ?!? In a module test I was localizing $^O to
lie about the OS to exercise some OS-specific behavior, using a loop;
one case was to use the actual OS of the cpan smoker, i.e. the original
$^O.)
FWIW, local $PID = $PID; works (doesn't have this problem), but local
$^F = $^F; becomes 0. I haven't tried others.
-Jim
$^O";'
dies because the localized $^O is undef. Doing local $^O = $^O."";
avoids the problem
(Why would anyone do that ?!? In a module test I was localizing $^O to
lie about the OS to exercise some OS-specific behavior, using a loop;
one case was to use the actual OS of the cpan smoker, i.e. the original
$^O.)
FWIW, local $PID = $PID; works (doesn't have this problem), but local
$^F = $^F; becomes 0. I haven't tried others.
-Jim