seek DATA,-6,1; # back up into __DATA__ string binmode DATA; $end = ; $end =~ s/.*__//; # delete everything except the line ending for(split//,$end){printf "0x%x\n",ord $_} __DATA__ # prints (on Win32) 0xd 0xa #### my $tmp = 'c:/tmp.tmp'; open TMP, "+>$tmp" or die $!; print TMP "\n"; seek TMP, 0, 0; binmode TMP; for(split//,){printf "0x%x\n",ord $_} close TMP; unlink $tmp; __END__ #prints (on Win32) 0xd 0xa