mikeraz@tire:~$ cat tpl #!/usr/bin/perl $criteria = "(abc|123)\$"; $teststring = "Foo walks up and says: abc"; if ( $teststring =~ /$criteria/ ) { print "it worked!\n"; } else { print "uh no, it did not\n"; } mikeraz@tire:~$ ./tpl it worked! mikeraz@tire:~$