http://www.perlmonks.org?node_id=1067003


in reply to Re: sorting headers in a file
in thread sorting headers in a file

Your code relies on a number of implicit assumptions: