my @sorted_referrers = sort { (split("|", $a))[2] cmp (split("|",$b))[2] } @referrers;