Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Invoking method in another package

by Dog and Pony (Priest)
on Sep 30, 2002 at 09:17 UTC ( [id://201656]=note: print w/replies, xml ) Need Help??


in reply to Invoking method in another package

It is essentially equal to:
Barfoo::thisone($fb);
Changing the call to that, and changing the name of the variable $self to something like $object won't change anything, but will make the code more readable, as well as making your intent more clear.

To me it seems you want a class method (as opposed to object method), or call it a function, that gets some information out of an object.

Does it need to be a real object at all? A hashref

$fb = { cow => 'moo' };
would give the same result if you don't need more stuff (like methods) inside Foobar.


You have moved into a dark place.
It is pitch black. You are likely to be eaten by a grue.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-19 02:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found