Please see How do I post a question effectively?: Please show the code you tried and use <code> tags to properly format your input, code, and output.
$ cat in.txt
1 2 3 delta
1 2 3 apricot
1 2 3 charlie
1 2 3 bravo
1 2 3 echo
1 2 3 fox
$ cat mysort.pl
#!/usr/bin/env perl
use warnings;
use strict;
my @rows;
while ( my $line = <> ) {
my @fields = split ' ', $line;
push @rows, \@fields;
}
@rows = sort { $a->[3] cmp $b->[3] } @rows;
for my $row (@rows) {
print join(' ', @$row ), "\n";
}
$ perl mysort.pl in.txt
1 2 3 apricot
1 2 3 bravo
1 2 3 charlie
1 2 3 delta
1 2 3 echo
1 2 3 fox
Update: To clarify: this is intended top be a simple example to get you started; it works on the data as you've provided it here, and I've had to guess what you want the output to look like. If it's not what you were looking for, then as I said, have a look at How do I post a question effectively? and also SSCCE.