From: Rafael Garcia-Suarez Date: Sun, 28 Dec 2008 22:20:46 +0000 (+0100) Subject: Fix line numbering issues with POD filtered by Switch.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6a9befb105d93024902eb178dab77655333f1829;p=p5sagit%2Fp5-mst-13.2.git Fix line numbering issues with POD filtered by Switch.pm Patch provided by Daniel Klein : I noticed a very subtle bug in the code: it filters out all detected POD from the source code. This means that any line number reporting after POD code will be out by the number of POD lines removed. So if there is an error or a "warn"ing in the code it will be harder for the programmer to track down. --- diff --git a/lib/Switch.pm b/lib/Switch.pm index aa1bade..4dbdeae 100644 --- a/lib/Switch.pm +++ b/lib/Switch.pm @@ -115,7 +115,8 @@ sub filter_blocks } next component; } - if ($source =~ m/\G\s*($pod_or_DATA)/gc) { + if ($source =~ m/(\G\s*$pod_or_DATA)/gc) { + $text .= $1; next component; } @pos = Text::Balanced::_match_variable(\$source,qr/\s*/);