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

Re: Re: subroutine help

by Seumas (Curate)
on Jun 28, 2003 at 19:04 UTC ( #269918=note: print w/replies, xml ) Need Help??


in reply to Re: subroutine help
in thread subroutine help

In addition to gjb's comments, if you are worried about requring too much 'stuff' that may not be needed during any one run, you could eval your commands and build your require/use list accordingly:
if($command = 'getuser') { eval { use MyCode::Users; }; getuser(); }

That way if you break up your code into multiple scripts and require them (as per gjb's comments), you are still only loading that which you need, dynamically. If you have a lot of subs and a lot of 'commands', this can require some precise forethought, but a little design could save you lots of resources in the long run.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://269918]
help
Chatterbox?
[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?
LanX ... though he can't lift more than one grown up at a time

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




    Results (161 votes). Check out past polls.