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
>
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
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:
> >
>
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
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
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..
--- 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
--- 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
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
--- 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
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
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
12 matches
Mail list logo