Skip Menu |

This queue is for tickets about the everywhere CPAN distribution.

Report information
The Basics
Id: 49394
Status: resolved
Priority: 0/
Queue: everywhere

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

Bug Information
Severity: Critical
Broken in: 0.05
Fixed in: (no value)



Subject: "qw/" is closed in $use_line
In line 60: ---- $use_line .= " qw/" . join(' ', @items) if @items; ---- "qw/" is not closed in above code, it should be: ---- $use_line .= " qw/" . join(' ', @items) . "/" if @items; ---- and I think it's better to attach every "use FOO;" code after "package BAR;", otherwise, module like Data::Dumper won't work. A modification is: ------ 69 if(open my $fh, "<", $full) { *70 my @lines = " "; 71 return ($fh, sub { 72 if(@lines) { 73 push @lines, $_; 74 $_ = shift @lines; *75 $_.= $use_line if /^\s*package\s+.+\s*;\s*$/; 76 return length $_; 77 } 78 return 0; 79 }); ------ lines begin with * are modified/added.
Sorry, the subject should be: "qw/" is not closed in $use_line
Subject: Re: [rt.cpan.org #49394] "qw/" is closed in $use_line
Date: Thu, 3 Sep 2009 09:12:21 -0400
To: Wang Hui via RT <bug-everywhere [...] rt.cpan.org>
From: Brock <awwaiid [...] thelackthereof.org>
Thanks for the report, I've released a new version with the fix (let me know if it isn't better!). For your per-package suggestion, I added a new flag "package_level => 1" that will do what you want. The modules I happen to use are file-scoped instead of package, but I can definitely see how both would be useful. I'm not completely sure what the default should be... possibly package scope but I left the default as file scope for now. --Brock On 2009.09.03.05.58, Wang Hui via RT wrote: | In line 60: | ---- | $use_line .= " qw/" . join(' ', @items) if @items; | ---- | "qw/" is not closed in above code, it should be: | ---- | $use_line .= " qw/" . join(' ', @items) . "/" if @items; | ---- | | and I think it's better to attach every "use FOO;" code after "package | BAR;", otherwise, module like Data::Dumper won't work. | A modification is: | ------ | 69 if(open my $fh, "<", $full) { | *70 my @lines = " "; | 71 return ($fh, sub { | 72 if(@lines) { | 73 push @lines, $_; | 74 $_ = shift @lines; | *75 $_.= $use_line if /^\s*package\s+.+\s*;\s*$/; | 76 return length $_; | 77 } | 78 return 0; | 79 }); | ------ | | lines begin with * are modified/added.