$ perl -e '$filename="clip.pl.txt"; ($filename =~ /\.pl$/) ? print("ok") : print("not ok");'; # Output: not ok