SPUG: How to deal with same name packages?

Colin Meyer cmeyer at helvella.org
Tue Jan 15 01:22:30 CST 2002

On Mon, Jan 14, 2002 at 10:04:22PM -0800, Chris Sutton wrote:
> Let say I had a local hash (my %hash).  To see the contents you have to say 

Maybe I'm feeling overly pedantic, but:

The code 'my %hash' declares a *lexical* hash. This is distinctly
different from 'local %hash', which declares the contents of %hash to be
local to the containing code block (dynamically scoped).

If this all makes perfect sense then fine. The meaning of the word
'local', due to its unfortunate historical use means not local, but
dynamic. I'd almost with the way you used the word, save for that
vestigial perl4 programmer in me. ;-)

Otherwise you may enjoy reviewing the section on 'Scoped Declarations'
in the Camel, and learn the details of the global, lexical and dynamic
scopes of Perl. (p. 129 v3, or p.107 v2)

Have fun,

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/

More information about the spug-list mailing list