elsif ($type =~ /name/) { for ( $c, $d ) { my $x = ( /^_(.*)/ ) ? $1 : substr( $_, rindex( $_, ' ' )); $_ = "$x $_"; } return $c cmp $d; }