open ($myimage, '<', $imagelocation) or die "cannot open '$imagelocation': $!"; binmode $myimage; ...