in reply to Odd behaviour with prototypes and Exporter

As far as I know, perl does prototype base argument parsing at *compile* time. So the fully qualified examples work because perl knows exactly which subroutine Foo::bar refers to, so it can parse the prototype correctly. However, your package->import() is a run-time statement, so perl can not tell at compile time that main::foo has a prototype.
  • Comment on Re: Odd behaviour with prototypes and Exporter

Replies are listed 'Best First'.
Re^2: Odd behaviour with prototypes and Exporter
by adrianh (Chancellor) on Aug 01, 2005 at 15:32 UTC
    However, your package->import() is a run-time statement, so perl can not tell at compile time that main::foo has a prototype.

    (... insert sound of man slapping forehead here ...)

    Of course. Me stupid. One BEGIN statement and problem solved.