in reply to regular expressions

If you are just beginning to learn regexes, the negative look-behind examples given in the other posts here may feel a little challenging. Here's an approach that uses more basic regex functionality.
#!/usr/bin/perl -w use strict; my @words = qw(COMA STORAMA HISTOROMA PUMA MELANOMA STOROMA); for my $str ( @words ) { if ($str =~ /OMA$/ and $str !~ /STOROMA$/ ) { print "$str\n"; } }

------------------------------------------------------------
"Perl is a mess and that's good because the
problem space is also a mess.
" - Larry Wall