Skip Menu |

This queue is for tickets about the namespace-autoclean CPAN distribution.

Report information
The Basics
Id: 67075
Status: open
Priority: 0/
Queue: namespace-autoclean

People
Owner: ether [...] cpan.org
Requestors: dwheeler [...] cpan.org
Cc:
AdminCc:

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



CC: bug-namespace-autoclean [...] rt.cpan.org
Subject: namespace::autoclean breaks sort
Date: Tue, 29 Mar 2011 20:37:41 -0700
To: bug-template-declare [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Not sure if this is a namespace::autoclean or Template::Declare issue; I suspect the former. On Perl 5.12.2, with this code: #!/usr/bin/env perl -w use 5.12.0; use namespace::autoclean; use Template::Declare::Tags; my @rels = ('foo', 'bar'); @rels = map { $_->[0] } sort { $b->[1] cmp $a->[1] } map { [ $_ => uc $_ ] } @rels; I the contents of $a and $b are empty! I get these warnings: Use of uninitialized value in string comparison (cmp) at /Users/david/bin/try line 11. Use of uninitialized value in string comparison (cmp) at /Users/david/bin/try line 11. Goes away if I comment-out namespace::autoclean. Probably shouldn't use it in a Template module anyway, but thought it worth mentioning. Seems pretty weird. Thanks, David
On 2011-03-29 20:37:51, DWHEELER wrote: Show quoted text
> Not sure if this is a namespace::autoclean or Template::Declare issue; > I suspect the former. On Perl 5.12.2, with this code: > > #!/usr/bin/env perl -w > > use 5.12.0; > > use namespace::autoclean; > use Template::Declare::Tags; > > my @rels = ('foo', 'bar'); > > @rels = > map { $_->[0] } > sort { $b->[1] cmp $a->[1] } > map { [ $_ => uc $_ ] } @rels; > > I the contents of $a and $b are empty! I get these warnings: > > Use of uninitialized value in string comparison (cmp) at > /Users/david/bin/try line 11. > Use of uninitialized value in string comparison (cmp) at > /Users/david/bin/try line 11. > > Goes away if I comment-out namespace::autoclean. Probably shouldn't > use it in a Template module anyway, but thought it worth mentioning. > Seems pretty weird. > > Thanks, > > David
Template::Declare::Tags is adding its own map() sub, which is definitely getting in the way.