On Sat Nov 12 06:54:33 2011, jkeenan wrote: > On Thu Jun 02 09:44:48 2005, root@millenium.ro wrote: > > > > This is a bug report for perl from g.badoi@millenium.ro, > > generated with the help of perlbug 1.34 running under perl v5.8.2. > > > > > > ----------------------------------------------------------------- > > Xref.pm (v 1.01) detects wrong line number for filehandles is some > > circumstances, > > as below: > > > > __________________________________________ > > > > #!/usr/bin/perl -w > > > > my $a = 1; > > > > if ($a) { > > print STDOUT "This line is misreported\n"; > > } > > __________________________________________ > > > > "perl -MO=Xref bug.pl >buf.xref" generates: > > > > __________________________________________ > > > > File t.pl > ... > > Subroutine (main) > > Package (lexical) > > $a i3, 5 > > Package main > > *STDOUT 5 > > ___________________________________________ > > > > reporting STDOUT as used at line 5 instead of line 6. > > > > I'm not sure this should be considered to be a bug. My (limited) > understanding of the B::* is that they're not necessarily expected to > account for all possible variations of whitespace. Absent whitespace, > > if ($alpha) { > print STDOUT "This line is misreported\n"; > } > > ... is equivalent to: > > if ($alpha) { print STDOUT "This line is misreported\n"; } What’s actually happening is that B::Xref is ignoring nulled cops, which is not terribly surprising, as B did not provide the cop fields for those until I added the feature, in 5.22 iirc. So yes, this is fixable. -- Father Chrysostomos --- via perlbug: queue: perl5 status: open https://rt.perl.org/Ticket/Display.html?id=36094Thread Previous