PDL list,
In continuation of the COW exchanges here is another 5.20 novelty
that gets me big: when a state plain scalar is copied to any other
scalar, then the state scalar becomes undefined. I hope this is a
bug .. and yes maybe it is time to try the perl porters list .. just
thought someone here might get it too, it can be subtle to track.
Below is a test that prints undefined in 5.20.1 but keeps the value
in 5.18.2.
Niels L
#!/usr/bin/env perl
use strict;
use warnings FATAL => qw ( all );
use feature "state";
&state_test();
&state_test();
sub state_test
{
state $str;
my ( $str_c );
$str = "string value";
print "before: ". $str ."\n";
$str_c = $str;
print " after: ". ( $str // "undef" ) ."\n";
return;
}
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl