I have no idea what that substr is trying to do, but perhaps you wanted:
#!/usr/bin/perl use strict; my $keyword = 'Three-element literal'; my $string = 'The fred array gets a Three-element literal'; if ($string =~ /$keyword/){ print "it is match!\n"; }else { print "it is not match!\n"; }
| We're not surrounded, we're in a target-rich environment! |
|---|
In reply to Re: match problem
by jasonk
in thread match problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |