I am trying to get a match on a line that begins with 'barney'. Below is the code. I have ran this and I always get the message, 'barney not found'. When I take the ^ and m away and just have /barney/, then it works.
$_ = 'This is a wilma line barney is on this line but this line ends with fred and a final dino line' ; if (/^barney/m) { print "Found barney \n"; } else { print "Barney not found \n"; } ~
Thanks in advance catfish
In reply to matching problem by catfish1116
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |