in reply to Re^3: Unusual variable declaration
in thread Unusual variable declaration
Why?
My is creating a pad entry for a lexically scoped variable, allocating and initializing it.
A pad is a symbol table in a hash structure similar to a stash.
Our is basically doing the same thing, apart from skipping to allocate space if the variable already exists.
My's destruction at the end of scope is hardly a criterion for declaration.
The pad is private, the stash is public and global. That's the basic difference.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Unusual variable declaration
by Jenda (Abbot) on Nov 05, 2019 at 11:19 UTC | |
by LanX (Saint) on Nov 05, 2019 at 12:27 UTC | |
by Jenda (Abbot) on Nov 05, 2019 at 16:33 UTC | |
by LanX (Saint) on Nov 05, 2019 at 16:45 UTC |