in reply to Re: scoping across parent/child relationship
in thread scoping across parent/child relationship

But I was wondering why you dont pass them as parameters to the functions? Then scoping doesnt become a problem

because i need them in both subs, and the actual variables are ( rather large ) config hashes. they can be global to the child ( if that makes sense )....

just trying to get the most out of laziness...

  • Comment on Re: Re: scoping across parent/child relationship

Replies are listed 'Best First'.
Re: Re: Re: scoping across parent/child relationship
by demerphq (Chancellor) on Aug 31, 2001 at 00:07 UTC
    Sorry but thats not a good reason. Pass them by reference, or in a hash, or even create an object that bundles them all together into a nice package.
    Globals vars are evil without very very good justification. There is almost always an easier and safer way to do things.
    Almost the only time I use them is for things like a $Debug variable in a package.

    OTOH, its your code.... :-)

    Yves
    --
    You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)
Re(3): scoping across parent/child relationship
by rchiav (Deacon) on Aug 31, 2001 at 00:05 UTC
    Then why not pass them as ref's?