.0000000001;2;1;.5;.2 .5;2;1;.5;.5 0.3;1.5;.5;.5;.2 1;1;.7;1;1 .4;1;.4;1;.5 #### #!/usr/bin/perl use strict; use diagnostics; use warnings; my $fh; my @lines = (); my @sortedlines = (); open($fh, "<", "filename") or die "I cannot open the file: $!\n"; chomp(@lines = <$fh>); @sortedlines = sort { $b =~ /(^\d*\.*\d+);/ <=> $a =~ /(^\d*\.*\d+);/ } @lines; print "SORTED LINES = @sortedlines\n";