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