Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the devel-nytprof CPAN distribution.

Report information
The Basics
Id: 39411
Status: resolved
Priority: 0/
Queue: devel-nytprof

People
Owner: Nobody in particular
Requestors: djh [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 2.03
Fixed in: (no value)



Subject: overenthusiastic #line detection
Download (untitled) / with headers
text/plain 1.3k
I have a comment in one of my programs that happens to start like this: # line by itself ... It causes nytprofhtml to emit a warning about ignoring a directive and profile data out of sync. UNIVERSAL::require apparently also has a comment that includes: #line $call_line "$call_file" that also causes a warning to be emitted. Of course, I'd prefer not to see these warnings and according to the Camel book section 24.5.2 the directive needs a line number. It even gives the specific regex used to detect a #line directive: /^#\s*line\s+(\d+)\s*(?:\s"([^"]+)")?\s*$/ Perhaps the following patch to Devel/NYTProf/Reader.pm could be considered: --- /tmp/Reader-2.03.pm 2008-08-15 14:11:00.000000000 +0100 +++ Devel/NYTProf/Reader.pm 2008-09-19 11:25:36.000000000 +0100 @@ -422,7 +422,7 @@ foreach my $regexp (@{$self->{user_regexp}}) { $line =~ s/$regexp->{pattern}/$regexp->{replace}/g; } - if ($line =~ m/^\# \s* line \b/x) { + if ($line =~ m/^\# \s* line \s+ \d+ \b/x) { # XXX we should be smarter about this - patches welcome! warn "Ignoring '$line' directive at line $LINE - profile data for $filestr will be out of sync with source!\n" unless our $line_directive_warn->{$filestr}++; # once per file
Fixed for next release. Thanks!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.