Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Common sub as method or function

by perrin (Chancellor)
on Aug 15, 2007 at 17:30 UTC ( [id://632804]=note: print w/replies, xml ) Need Help??


in reply to Common sub as method or function

You should make them methods. If the rest of the API is OO, you may want to subclass things someday, and making these OO as well would be important then.

However, these sound like class methods to me, not object methods. You should call them with the class name, not the object reference:

my $class = ref $self; # if calling from an object method $class->timestamp();

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-29 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found