I am trying to do the following. I have 2 variables
eg. $line='123: ABC/1.0/VAL [111:222:333:444]';
and $cont='ABC/1.0/VAL [111:222:333:444]';
And I have written the following in order to merely identify that the contents of $cont are contained with the contents of $line
But I keep getting a no match message and can't understand why. I'd really appreciate a response asap as this is seriously holding my work upif ($head=~/$cont/) { print "We have a match\n"; } else { print "No match\n"; }
update (broquaint): added <code> tags and formatting
In reply to Find a string within a string by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |