perl -MPOSIX -le'print strftime "%X %x", localtime(time)' 12:28:59 18/03/05 #### #!/usr/bin/perl use warnings; use strict; my @businesses=( ['foo', 'bar', 'baz'], ['een', 'twee', 'drie'], ['ichi', 'ni', 'san'], ['hydrogen', 'helium', 'lithium'], ); my %regexen; foreach my $group (@businesses) { print "making regex from group @{$group} ... "; my $regex=join "|", @$group; print "\\$regex\\\n"; my $compiled_re=qr/$regex/; $regexen{$regex}=$compiled_re; } while (my $line = ) { for my $group (keys %regexen) { next unless $line =~ /$regexen{$group}/; print "The line $line matched the bussiness group $group\n"; } } __DATA__ nosuch foo this that helium ballon ichi foot een