http://www.perlmonks.org?node_id=99292


in reply to Data length in strings

Instead of using $/, try reading the file.

open my $fh, $file_name or die "Cannot open $file_name $!"; read $fh, my $str, -s $fh;

HTH,
Charles K. Clarkson