Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: Re: Using a subroutine as a module

by ysth (Canon)
on Nov 03, 2003 at 06:25 UTC ( #304025=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Using a subroutine as a module
in thread Using a subroutine as a module

I would rather use class methods than create a dummy object with no other purpose than to qualify the package to call.

File::Spec is an excellent example of when that works well.

In the more typical case, however, you would be just as well off importing nothing and always fully qualifying your calls (e.g. MyModule::foo() ). Importing some things is a programmer convenience to save typing and improve readability. If the sub names reflect what they do, conflicts should be rare (and can always be resolved by fully qualifying).


Comment on Re: Re: Re: Using a subroutine as a module

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2014-12-27 20:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls