From perlsub:
Variables declared with "my" are not part of any package and
are therefore never fully qualified with the package name.
and again:
A note about "local()" and composite types is in order.
Something like "local(%foo)" works by temporarily placing a
brand new hash in the symbol table. The old hash is left
alone, but is hidden "behind" the new one.
and:
It's also worth taking a moment to explain what happens when
you "local"ize a member of a composite type (i.e. an array
or hash element). In this case, the element is "local"ized
by name. This means that when the scope of the "local()"
ends, the saved value will be restored to the hash element
whose key was named in the "local()", or the array element
whose index was named in the "local()".
So, if I say
my @foo = (0..9);
then say
local $foo[3] = 'bar';
that a symbol table entry is created?
that it is still ignored for every other element of @foo, but
that it overrides it my() equivelent element since it, specifically, was local()ized?
Ok, this is deeply wierd.
Somebody help me get this one?
And please feel free to email me at ydbxmhc@yahoo.com, okay?
This one's hurting my brain. :)
Paul
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.