# regexp filter # input from STDIN, output to STDOUT use strict; # Enter your word list pattern on the line below # Example: ...= "red|sony|camcorder"; my $regexp = ""; { my $i = 0; my %sort_order = map {ucfirst lc $_ => $i++} split(/\|/, $regexp); sub list_order {$sort_order{$a} <=> $sort_order{$b}}; } while () { print join('', sort list_order map {ucfirst lc} m/\b($regexp)\b/gi), "\n"; } # RKGDUCK # documentation at www.rimmkaufman.com/duck