my $str = "update patch-5.1.1.21510" my $patch = "patch-5.1.1.21510.gpg"; if( $str =~ /$patch/ms ) { print "Your Perl is broken!!!\n"; }