open(my $pb, $ARGV[0]); binmode $pb; read $pb, $data, $chunk_len; open my $chunk_fh, '<', \$data; read $chunk_fh, my $int_type, 1; say $int_type; # correctly prints C, S, or I, but mysterious extra new +line. say length $int_type; # reports 1 as expected. chomp $int_type; my $read_len = { C => 1, S => 2, I => 4}->{$int_type}; # Doesn't match + any keys.
[download]