in reply to Re^4: Writing to File based on condition
in thread Writing to File based on condition

print $out sort keys %old;

Try that. As is, this would print all keys concatenated together as one string. That's fine if each key has a trailing record separator attached.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'