in reply to Cropping the output of the pattern matcher
Looks like some of your slashes are going the wrong way... but anyhoo - if you want to 'crop' the data you need to do a little syntactical trick:
Instead of matching something so specific (\w and \s), match everything BUT the closing tag: [^<]+while(<>) { if (my ($matched) = $_ =~ />([^<]+)</) { print "'$matched': on line $.\n"; } }
jeffa
|
|---|