Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: invoking module functions from a test script

by haukex (Archbishop)
on Nov 27, 2019 at 18:34 UTC ( #11109318=note: print w/replies, xml ) Need Help??


in reply to invoking module functions from a test script

Can't locate object method "create_query" via package "My::NEW::Module" at ../lib/My/NEW/Module.pm line 46.

My::NEW::Module::get_unpublished('My::NEW::Module', 'My::OLD::Module::Connect=HASH(0x45dcd98)', 10, 250) called at module_test.t line 44

So a function that takes (and has been called with) three parameters is actually (somehow) winding up with four instead.

Sounds like you accidentally wrote My::NEW::Module->get_unpublished(...) when you meant My::NEW::Module::get_unpublished(...)?

Otherwise, try reducing the code down to the bare minimum needed to reproduce the problem, so you can post it here - see Short, Self-Contained, Correct Example.

Replies are listed 'Best First'.
Re^2: invoking module functions from a test script
by chexmix (Hermit) on Nov 27, 2019 at 18:37 UTC

    Well, um. Right you are!

    Thanks and sorry for ... well, for too many words ;)

    G

      if rubber ducks had ears ...

      (bottom line is: in calling an object's method, $object->method(1,2,3), 1st received param is always the object ref, followed by all other params you called that method with, the 1,2,3. That's not the same when calling a class method "statically", e.g. class::method(1,2,3) -- you get 1,2,3 as params, no object ref this time as there is none.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11109318]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2022-10-06 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (26 votes). Check out past polls.

    Notices?