in reply to Re^2: how to export a method
in thread how to export a method
Ah, I completely missed the fact that you're mixing Exporter with OO programming. My mistake for not spotting that sooner. But the error message you're getting has nothing with Exporter, because object methods don't need to be (and should not be) exported, because there's no reason to pollute the caller's namespace when object methods can be called regardless. The real problem is evident in the error message you get:
Can't locate object method "rp" via package "PDL" at test_pdl6.pl line 27.Is for the class "PDL", rather than your "PDL::CV" package where the rp method is defined. The problem must lie with your test (caller) code in test_pdl6.pl, because aside from the needless use of Exporter, your package's code looks reasonable.
This should have been my top level reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: how to export a method
by toothedsword (Sexton) on Oct 22, 2019 at 05:45 UTC | |
by AnomalousMonk (Archbishop) on Oct 22, 2019 at 06:36 UTC | |
by toothedsword (Sexton) on Oct 22, 2019 at 15:06 UTC | |
by wanna_code_perl (Friar) on Oct 22, 2019 at 05:56 UTC | |
|
Re^4: how to export a method
by toothedsword (Sexton) on Oct 22, 2019 at 06:05 UTC |