Paul writes:
--- Brian Ingerson [EMAIL PROTECTED] wrote:
Garrett Goebel wrote:
From: Paul [mailto:[EMAIL PROTECTED]]
Anybody know offhand *why* my() lexicals are supposedly faster?
Yes this is OT, but I'll contribute to the problem as well...
My coworker Gisle
Paul wrote:
--- Robert Landrum [EMAIL PROTECTED] wrote:
I could be wrong, but as I recall, when your program enters a scope,
perl immediatly identifies the the scratchpad to use. Then, it need
only search backwards up the tree of scratchpads to find the variable
"$x", which is faster
Many thanks to everyone, Malcolm in particular, for humoring my
curiosity and assisting my esoteric research.
Hope it helped someone else, too, and sorry for cluttering up the
board.
But it *dod* say it was Very[OT]. ;o)
Paul
--- Malcolm Beattie [EMAIL PROTECTED] wrote:
Paul writes:
---
Title: RE: Very[OT]:Technical query re: scratchpad lookups for my() vars
From: Paul [mailto:[EMAIL PROTECTED]]
Anybody know offhand *why* my() lexicals are supposedly faster?
Because a dynamic variable allocates a new value at runtime which occludes the global value until it's scope
Garrett Goebel wrote:
From: Paul [mailto:[EMAIL PROTECTED]]
Anybody know offhand *why* my() lexicals are supposedly faster?
Because a dynamic variable allocates a "new" value at runtime which occludes
the global value until it's scope expires. In contrast, a lexical variable
is unique
Anybody know offhand *why* my() lexicals are supposedly faster?
If they're stored on a scratchpad for the scope, which is an array,
(technically a stack of them to accommodate recursion,) then exactly
how does Perl go about finding which data location you mean when you
say $x for a lexical? $::x
--- Robert Landrum [EMAIL PROTECTED] wrote:
I could be wrong, but as I recall, when your program enters a scope,
perl immediatly identifies the the scratchpad to use. Then, it need
only search backwards up the tree of scratchpads to find the variable
"$x", which is faster than iterating
At 03:52 PM 3/14/01 -0800, Paul wrote:
But nothing about the structural/algorithmic mechanics. :
From the perlsub docs:
Variables declared with my are not part of any package and are therefore
never fully qualified with the package name. In particular, you're not
allowed to try to make a
--- Elizabeth Mattijsen [EMAIL PROTECTED] wrote:
At 03:52 PM 3/14/01 -0800, Paul wrote:
But nothing about the structural/algorithmic mechanics. :
From the perlsub docs:
Variables declared with my are not part of any package and are
therefore
never fully qualified with the package