I honestly don't see any documentation on what this feature is called so I don't know what to ask for however the best way I can think of it is the property demonstrated in the perlboot tutorial.
1. # Cow::speak, Horse::speak, Sheep::speak as before
2. @pasture = qw(Cow Cow Horse Sheep Sheep);
3. foreach $animal (@pasture) {
4. &{$animal."::speak"};
5. }
I want to use the same principle in a parser i'm working on, creating a new (struct or hash) for every occurence of a variable declaration in my custom script utilities.
What I want it to look like is to say, have @array_vars
format of the script declarations
(global <type> <name> <value>) initializing with a value being optional.
I want (dont know if I need?) a hash//struct entry in the array to be created every time there is an occurence of a global. so:
@array-><name> = TYPE => BOOLEAN, VALUE => "UNINITIALIZED"
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.