develooper Front page | perl.perl5.porters | Postings from February 2018

[perl #132833] COW bug in :encoding layer

Thread Next
February 8, 2018 20:17
[perl #132833] COW bug in :encoding layer
Message ID:
# New Ticket Created by   
# Please include the string:  [perl #132833]
# in the subject line of all future correspondence about this issue. 
# <URL: >

Following code modifies variable $valid:

use strict;
use warnings;
use Data::Dumper;

my $valid = "\x61\x00\x00\x00";
my $tmp = $valid;
print Dumper $valid;
open my $fh, '<:encoding(UTF32-LE)', \$tmp or die;
my $str = <$fh>;
close $fh;
print Dumper $valid;

Output is:

$VAR1 = 'a';
$VAR1 = '';

This is perl 5, version 24, subversion 1 (v5.24.1) built for x86_64-linux-gnu-thread-multi

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About