Re: Very[OT]:Technical query re: scratchpad lookups for my() vars

2001-03-14 Thread Robert Landrum
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 through the STHASH looking for a localized or glo

Re: Very[OT]:Technical query re: scratchpad lookups for my() vars

2001-03-14 Thread Paul
--- 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 iterat

Re: Very[OT]:Technical query re: scratchpad lookups for my() vars

2001-03-14 Thread Elizabeth Mattijsen
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 pac

Re: Very[OT]:Technical query re: scratchpad lookups for my() vars

2001-03-14 Thread Paul
--- 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 p

Re: Very[OT]:Technical query re: scratchpad lookups for my() vars

2001-03-14 Thread Paul
--- 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 Aas (maybe

Re: Very[OT]:Technical query re: scratchpad lookups for my() vars

2001-03-15 Thread Malcolm Beattie
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..

Re: Very[OT]:Technical query re: scratchpad lookups for my() vars

2001-03-15 Thread Alexander Farber (EED)
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

Re: Very[OT]:Technical query re: scratchpad lookups for my() vars

2001-03-15 Thread Alexander Farber (EED)
Paul wrote: > None of this is critical for anything I'm doing right now, but I'm a > detail hound. I want to *understand* it, so that in the future I can > make intelligent decisions about what would be a "better" way to write > any given algorithm, without just relying on popular wisdom and "urba

Re: Very[OT]:Technical query re: scratchpad lookups for my() vars

2001-03-15 Thread Paul
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: > > >

RE: Very[OT]:Technical query re: scratchpad lookups for my() vars

2001-03-15 Thread Garrett Goebel
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

Re: Very[OT]:Technical query re: scratchpad lookups for my() vars

2001-03-15 Thread Brian Ingerson
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 >