Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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?
[Corion]: LanX: Ah, yeah - Frankfurt is in the quake region, but at the very border. I think I've never noticed a quake in Frankfurt myself
[marto]: good morning all
[Corion]: On another topic, in the process of Rubber Duck SoPWing, I wrote a post about the best API for generating HTTP requests (not sending them) and while writing it and fleshing out my sample implementation, I came up with some improvements to my ...
[Corion]: ... existing prototype. Cartesian Products will be proud of that module once it gets out ;)
[Corion]: Hi marto ;)
LanX has the same problem with English accents ...
[LanX]: Will Cartesian Products still be tarif free after Brexit?

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2017-01-18 10:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (161 votes). Check out past polls.