Tad McClellan <> wrote:
> James Willmore <> wrote:
> > (Tad McClellan) wrote in message news:<>.. .
>
>
> >> You should always prefer lexical variables over package
> >> variables, except when you can't.
>
> > Okay, now you've given me a concept to read about (lexical). I seen
> > it, heard about it, and, I fear greatly to say this, but don't
> > understand it.
>
>
> Lexical variables are the ones that are _easy_ to understand.
>
> It is package variables that are harder to understand.
>
Conceptually, perhaps, yes. But the term _lexical_ itself occludes
the simplicity of the idea. The term _package_ finds expression in the
perl syntax and is similar in its use there as it is in human languages,
whereas the _lexical_ is an uncommon word and it appears to be used in an
essentially metaphorical manner in describing the scope of stuff in Perl.
The perlfaq item:
How can I access a dynamic variable while a
similarly named lexical is in scope?
seems to make a further leap by assuming the reader will fill in the
'ly scoped variable' (yes, the patch is in the post
So on balance I'm not surprised that people find lexically scoped thingies
( and how much more difficult it is on the brain when these things aren't
simple identifiers like variables) more difficult to understand than
package scoped ones.
Now what was my point again?
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|