Ahhhh, i am starting to see now:
- my declares a local variable which is not found in
a package's symbol table
- a local var does show up in the symbol table, but
if you use strict, then you have to fully qualify the
variable name (that is, prefix the package name)
- our handles the strict vs. non-fully qualified local
vars
perrin pointed me to CPAN and the
Devel::Symdump
module. Here is another snippet to help explain:
#!/usr/bin/perl
#use strict;
use Devel::Symdump;
my $obj = Devel::Symdump->new('Foo');
print map {"$_\n"} $obj->scalars;
package Foo;
local $Foo::qualified;
local $unqualified;
our $our;
my $my;
Which (without use strict) produces this ouput :
Foo::qualified
Foo::our
Foo::unqualified
If strict is turned on, then $unqualified will cause a
compliation error. I think i get it now! :)
Thank you tachyon, perrin, and also rob_au for
pointing out What is it adding to my symbol table?.
jeffa
L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)
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.