in reply to matching problem

Hi,
On the second line of $_, there's a number of whitespace characters that precede "barney" - hence that line does not begin with "barney":
$_ = '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"; } $_ = '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"; } __END__ Outputs: Barney not found Found barney

Cheers,
Rob