in reply to Dumping symbol table shows variables declared with our but not my

The variables you declared with   my   are lexically scoped variables.
They do not live in the   package main,   hence you cannot see them there;
That is what lexicals and the my-keyword are all about.

See   Variable scoping   in   perldoc perlintro   for a first glance
and   Private Variables via my()   in   perldoc perlsub   for better explanation of   my.

Edit: added links to perlsub which has better documentation. And the following:
perldoc -f our   says that the variable is part of the package.

Cheers, Sören

  • Comment on Re: Dumping symbol table shows variables declared with our but not my

Replies are listed 'Best First'.
Re^2: Dumping symbol table shows variables declared with our but not my
by Popcorn Dave (Abbot) on Oct 11, 2004 at 02:36 UTC
    Thanks for cleraring up my misconceptions. I was always under the assumption that if it's not in a module, it's in main::

    Useless trivia: In the 2004 Las Vegas phone book there are approximately 28 pages of ads for massage, but almost 200 for lawyers.
      I was always under the assumption that if it's not in a module, it's in main::

      That's true for package variables, but lexical variables (the kind you get when you use my) are not package variables. They don't live in any package at all.