[Canberra-pm] do read-local.config

Andrew Pollock andrew-pm at andrew.net.au
Wed Mar 29 21:43:26 PST 2006


On Thu, Mar 30, 2006 at 01:21:27PM +1100, Michael James wrote:
> In the perl cookbook it suggests a good way to keep
>  local configuration details out of a larger and messier script
>  is to put normal perl code into a separate file and  "do"  it.
> 
> But in a throwaway line (middle of page 328) it says,
>  of course neither the doer nor the done will have access
>  to the other's lexical (my) variables.
>  
> Hang ON! Lets get this clear,  the  done.config  file
>  can't create a variable visible to the calling program,
>  nor see a pre-existing variable to change it.
> 
> What's the point?
> 
> Can any of you lexicographers explain
>  a way around this, to a bear of limited scope?

Reading the output of a perldoc -f do, it doesn't say anything about the
variables defined in the file being "done" not being visible to the caller,
but I could imagine anything declared with "my" wouldn't be visible, so just
don't use "my" in the config file being "done"?

regards

Andrew


More information about the Canberra-pm mailing list