my $ignore = '(^The )|(^A )'; ... @sorted = sort { $a =~ s/$ignore//; $b =~ s/$ignore//; lc( $a ) cmp lc( $b ); } @indata;