Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: returning a hash from a module

by choroba (Canon)
on Feb 28, 2013 at 20:47 UTC ( #1021111=note: print w/ replies, xml ) Need Help??


in reply to returning a hash from a module

The problem is you call the subroutine as a class method:

MyDB->get_transaction(10000);
Therefore, the first argument to the subroutine is not the id, but the class name. Insert the following line to the top of the sub:
my $class = shift;
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: returning a hash from a module
Select or Download Code
Re^2: returning a hash from a module
by jms53 (Monk) on Mar 01, 2013 at 19:13 UTC
    Thanks! Now it's always returning something, although now it's an empty hash. Looks like I have some cleaning up to do in the module over the week end.
    J -

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021111]
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 2015-07-04 02:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls