Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: cleaning up code with "do" ?

by Zaxo (Archbishop)
on Aug 18, 2004 at 22:03 UTC ( #384126=note: print w/ replies, xml ) Need Help??


in reply to cleaning up code with "do" ?

That says that subs in your file cannot participate in lexical closures with variables in the including file. Big packages often have such closures, and subs imported with do will fail. Make sure all subs get all their parameters from arguments passed to them.

My own practice is to only do for subs like those and for a single configuration hashref as the return value for the file when done.

my $config = do "$ENV{HOME}/.foobarc";

After Compline,
Zaxo


Comment on Re: cleaning up code with "do" ?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2014-09-22 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (191 votes), past polls