Aristotle has asked for the wisdom of the Perl Monks concerning the following question:

Ok, I'm utterly confounded.

{ package Promotion::Promotion; our @ISA = qw( Promotion::DBI ); __PACKAGE__>table( 'promotion' ); __PACKAGE__>columns( All => qw( id name ) ); }

Perl complains that it can't find Promotion::Promotion::table on the respective line.

An intermittently inserted debug print calling can() could find the method though. So:

{ package Promotion::Promotion; our @ISA = qw( Promotion::DBI ); __PACKAGE__->can( 'table' )->( __PACKAGE__, 'promotion' ); __PACKAGE__->can( 'columns' )->( __PACKAGE__, All => qw( id name ) + ); }

This works.

Errm… what's going on here?

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Method lookup fails?
by bmann (Priest) on Jan 11, 2005 at 00:08 UTC
    __PACKAGE__>table( 'promotion' ); __PACKAGE__>columns( All => qw( id name ) ); # ^ missing hyphen??

    Is that a copy/paste error or a typo?

      Augh!! Well, I fully expected it to be such a boneheaded error. But try as I might I couldn't spot the problem.

      Oh well. Thanks for lending me your pair of eyeballs. :-)

      Makeshifts last the longest.