in reply to Sample Sort Code

You'll probably want to split it into an array, possibly with substr or unpack, then use sort to sort it. Something like:
#!/usr/bin/perl use warnings; use strict; our @rows; while (<>) { chomp; push @rows,[unpack("a10a13a6a8a13a5",$_)]; } @rows = sort { $a->[0] cmp $b->[0] || $a->[1] cmp $b->[1] || $a->[4] cmp $b->[4] } @rows;

Update: Fixed field sizes, which are clearer now that the post is cleaned up.