Skip Menu |

This queue is for tickets about the Acme-BooK-Is-My-Bitch CPAN distribution.

Report information
The Basics
Id: 21297
Status: resolved
Priority: 0/
Queue: Acme-BooK-Is-My-Bitch

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

Bug Information
Severity: Important
Broken in: 0.01
Fixed in: 0.03



Subject: Get the list of functions from the %methods hash
You do not need to grep through %{'Acme::BooK::Is::My::Bitch::'} to find all the available methods in random_quote(). It would be more accurate to just use "keys %methods". Because you see, VERSION() is also a function... 02:35 <BooK> be book 02:35 <purl> BooK: My next lightning talk will be called "touche! klosh!! zok!!!" 02:35 <BooK> be book 02:35 <purl> BooK: 0.01
From: BOOK [...] cpan.org
On Sun Sep 03 10:58:22 2006, BOOK wrote: Show quoted text
> You do not need to grep through %{'Acme::BooK::Is::My::Bitch::'} > to find all the available methods in random_quote(). > > It would be more accurate to just use "keys %methods".
Here's the patch. :-)
--- Acme-BooK-Is-My-Bitch-0.02/lib/Acme/BooK/Is/My/Bitch.pm 2006-09-03 12:44:05.000000000 +0200 +++ Acme-BooK-Is-My-Bitch-patch/lib/Acme/BooK/Is/My/Bitch.pm 2006-09-06 13:59:10.000000000 +0200 @@ -63,12 +63,7 @@ no strict 'refs'; - my @methods = ( - grep { !/^(?:_.*|BEGIN|metaname|new)$/ } - keys %{"Acme::BooK::Is::My::Bitch::"} - ); - - my $method = $methods[ rand @methods ]; + my $method = (keys %methods)[ rand keys %methods ]; return $self->$method(); }
RT-Send-CC: BOOK [...] cpan.org
Le Mer 06 Sep 2006 08:01:46, BOOK a écrit : Show quoted text
> On Sun Sep 03 10:58:22 2006, BOOK wrote:
> > You do not need to grep through %{'Acme::BooK::Is::My::Bitch::'} > > to find all the available methods in random_quote(). > > > > It would be more accurate to just use "keys %methods".
This is maybe an intended behavior designed by the author. See #60762 https://rt.cpan.org/Ticket/Display.html?id=60762 -- Olivier Mengué - http://search.cpan.org/~dolmen/ http://github.com/dolmen/