I see in my earlier posting that I referred to the fully-qualified variable improperly. I should have said @main::whatever, not main::@whatever. I think that I understand that @main::whatever qualifies it, assuming I'm declaring the value in the 'main' part of the program and not in a subroutine somewhere, for the rest of the program.
If I use it within a subroutine (declaring it first in the 'main' portion of the program), am I correct to understand that I should pass it to the subroutine as subroutine_name(\@main::whatever)?
In any case, here's the answer to your question to me--
Doing:
use strict;
use warnings;
@existingattributes = ();
Produces the error:
Global symbol "@existingattributes" requires explicit package name at C:\Perl\scripts\configurator.pl line 5.
Execution of C:\Perl\scripts\configurator.pl aborted due to compilation errors.
But perl is happy when I do this:
use strict;
use warnings;
# initialize arrays
@main::existingattributes = ();
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.