Seeing as it happens with (eg.) CGI (etc.), this suggests a debugger bug.
richard@thpad:~> perl -MCGI -de 0
Loading DB routines from perl5db.pl version 1.3
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
main::(-e:1): 0
DB<1> m CGI->new
Not a subroutine reference at /usr/lib/perl5/5.10.0/perl5db.pl line 7934.
at /usr/lib/perl5/5.10.0/perl5db.pl line 7934
DB::methods_via('CGI', '', 1) called
at /usr/lib/perl5/5.10.0/perl5db.pl line 7904
DB::methods('CGI=HASH(0xd73f00)') called
at /usr/lib/perl5/5.10.0/perl5db.pl line 670
DB::eval called at /usr/lib/perl5/5.10.0/perl5db.pl line 3436
DB::DB called at -e line 1
Debugged program terminated. Use q to quit or R to restart,
use o inhibit_exit to avoid stopping after program termination,
h q, h R or h o to get additional info.
DB<2>
The relevant bit is here (xxx):
7920 sub methods_via {
7921
7922 # If we've processed this class already, just quit.
7923 my $class = shift;
7924 return if $seen{$class}++;
7925
7926 # This is a package that is contributing the methods we're about to
print.
7927 my $prefix = shift;
7928 my $prepend = $prefix ? "via $prefix: " : '';
7929
7930 my $name;
7931 for $name (
7932
7933 # Keep if this is a defined subroutine in this class.
7934 grep { defined &{ ${"${class}::"}{$_} } } # <- here (xxx)!
7935
7936 # Extract from all the symbols in this class.
7937 sort keys %{"${class}::"}
7938 )
7939 {
7940
7941 # If we printed this already, skip it.
7942 next if $seen{$name}++;
7943
7944 # Print the new method name.
7945 local $\ = '';
7946 local $, = '';
7947 print $DB::OUT "$prepend$name\n";
7948 } ## end for $name (grep { defined...
--
Richard Foley
Ciao - shorter than aufwiedersehen
http://www.rfi.net/
On Tuesday 14 July 2009 12:40:50 Ovid wrote:
>
> I honestly have no idea if this is a bug in DateTime or the debugger. If
it's a bug in the debugger, it would be nice to fix and I don't have time to
look at it right now.
>
> Basically, when in the debugger, you can type "m" following by an object and
it will list the methods available on that object. Here's an example of it
failing when trying with a DateTime object.
>
> $ perl -MDateTime -de 1
>
> Loading DB routines from perl5db.pl version 1.3
> Editor support available.
>
> Enter h or `h h' for help, or `man perldebug' for more help.
>
> main::(-e:1): 1
> DB<1> m DateTime->now
> Not a subroutine reference at /usr/share/perl/5.10/perl5db.pl line 7930.
> at /usr/share/perl/5.10/perl5db.pl line 7930
> DB::methods_via('DateTime', '', 1) called
at /usr/share/perl/5.10/perl5db.pl line 7900
> DB::methods('DateTime=HASH(0x94fb878)') called
at /usr/share/perl/5.10/perl5db.pl line 670
> DB::eval called at /usr/share/perl/5.10/perl5db.pl line 3434
> DB::DB called at -e line 1
> Debugged program terminated. Use q to quit or R to restart,
> use o inhibit_exit to avoid stopping after program termination,
> h q, h R or h o to get additional info.
>
> Cheers,
>
> Ovid
> --
> Buy the book - http://www.oreilly.com/catalog/perlhks/
> Tech blog - http://use.perl.org/~Ovid/journal/
> Twitter - http://twitter.com/OvidPerl
> Official Perl 6 Wiki - http://www.perlfoundation.org/perl6
>
>