Skip Menu |

This queue is for tickets about the Perl6-Say CPAN distribution.

Report information
The Basics
Id: 11838
Status: resolved
Worked: 10 min
Priority: 0/
Queue: Perl6-Say

People
Owner: jkeenan [...] cpan.org
Requestors:
Cc:
AdminCc:

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



Subject: Perl6::Say does not export on second use.
Perl6::Say only exports into the package which loads the module. It does not export into subsequent "use"s. This is because it has no import() method. package Foo; use Perl6::Say; say "Foo"; package Bar; use Perl6::Say; say "Bar"; # error The attached patch fixes this. I also notice the 1.t test was complaining about "use of uninitialized value in open" and fixed that.
--- /dev/null 2005-03-10 15:09:17.000000000 -0800 +++ t/export.t 2005-03-10 15:05:49.000000000 -0800 @@ -0,0 +1,17 @@ +#!/usr/bin/perl -w + +# Check that Perl6::Say exports properly. It didn't. + +use Test::More tests => 2; + + +package Foo; +use Perl6::Say; + +::can_ok 'Foo', 'say'; + + +package Bar; +use Perl6::Say; + +::can_ok 'Bar', 'say'; \ No newline at end of file --- MANIFEST 2004-03-25 14:00:02.000000000 -0800 +++ MANIFEST 2005-03-10 15:05:32.000000000 -0800 @@ -4,3 +4,4 @@ README Say.pm t/1.t +t/export.t --- Say.pm 2004-03-28 05:11:43.000000000 -0800 +++ Say.pm 2005-03-10 15:07:05.000000000 -0800 @@ -4,12 +4,16 @@ # Handle direct calls... -*{caller().'::say'} = sub { print @_, defined $\ ? "" : "\n" }; +sub say { print @_, defined $\ ? "" : "\n" }; # Handle OO calls: sub IO::Handle::say { my ($fh) = shift; print {$fh} @_, defined $\ ? "" : "\n" } +sub import { + *{caller().'::say'} = \&say; +} + 1; __END__ --- t/1.t 2004-03-26 20:14:11.000000000 -0800 +++ t/1.t 2005-03-10 15:05:15.000000000 -0800 @@ -1,3 +1,5 @@ +#!/usr/bin/perl -w + use Test::More no_plan; BEGIN { use_ok('Perl6::Say') }; @@ -7,7 +9,7 @@ Test::Builder->current_test(4); -my $str; +my $str = ''; open FH, '>', \$str; ok( (say FH 'what'), 'Indirectly said: "what"' );
Date: Fri, 11 Mar 2005 10:28:24 +1100
From: Damian Conway <damian [...] conway.org>
To: bug-Perl6-Say [...] rt.cpan.org
Subject: Re: [cpan #11838] Perl6::Say does not export on second use.
RT-Send-Cc:
Michael_G_Schwern via RT wrote: Show quoted text
> Perl6::Say only exports into the package which loads the module. It does not export > into subsequent "use"s. This is because it has no import() method. > > I also notice the 1.t test was complaining about "use of uninitialized value in open" > and fixed that.
Yeah, those were both silly mistakes on my part. Fixed and uploaded. Thanks! Damian
RT-Send-CC: dconway [...] cpan.org,dagolden [...] cpan.org
Damian fixed this in 0.04. Jim Keenan co-maintainer
On Sat Jul 22 22:53:22 2006, JKEENAN wrote: Show quoted text
> Damian fixed this in 0.04. > > Jim Keenan > co-maintainer
Let's see if this changes status to resolved.