open(my $fh, '<', $datafile) or die ("Could not open file \"datafile\": $!\n"); binmode($fh); my $rawdata; { local $/; $rawdata = <$fh>; }