It's two class variables - one is a hash, the other is an array of hashes, so sticking them in a constant is messy ( because then its a constant to an anonymous ref , which is a PITA when dereferencing. Both are used by class instances as configuration settings- i glanced at teh code the other day and realized 'hey, with a few more lines i could totally abract these 3 functions into 1' and did.
For now, I just stuck a reference to the data in the instance, but i hate doing that with these structures, because now instead of:
sub func(){
my ($self) = @_;
foreach my $a (@b){}
foreach my $a (keys %c){}
}
i have
sub func(){
my ($self) = @_;
my @b = @{$self->{'_class_b'}}
my %c = %{$self->{'_class_c'}}
...
}
which does that annoying coercion into a new array / hash ( i can't just deref and address the needed items, as i need t o loop and nest through them all)
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.