What steps will reproduce the problem?
1. compile and run the following script
> cat script.pl
$a = chr(300);
my $l = length($a);
my $lb;
{ use bytes; $lb = length($a); }
print( ( $l == 1 && $lb == 2 ) ? "ok\n" : "l -> $l ; lb -> $lb\n" );
__END__
What is the expected output ?
> perl script.pl
ok
What do you see instead?
> for i in `seq 0 3`; do perlcc -O$i script.pl && ./script; done
l -> 1 ; lb -> 1
l -> 1 ; lb -> 1
l -> 1 ; lb -> 1
l -> 1 ; lb -> 1
Please use labels and text to provide additional information.
note that if bytes is lazyloaded then it works
eval q{ use bytes; $lb = length($a) };
Original issue reported on code.google.com by nicolas....@gmail.com on 3 Dec 2013 at 5:02
Original issue reported on code.google.com by
nicolas....@gmail.com
on 3 Dec 2013 at 5:02