I am only just beginning to get refs, despite having read Camel on the subject and many posts here. Actually, I am not even getting them, I am cargo_cult programming ("Hmm this worked before let's try it again").
The problem:I can populate cells with Tr (\@cells) where @cells is:
@rows = map {$q->td( {-align=>'left'}, b("$_ Parish:") ).
$q->td( {-bgcolor=>"$data"},@{$info{$_}}[$index]).
$q->td( {-bgcolor=>"$data"},@{$info{$_}}[$index2]).
$q->td( {-bgcolor=>"$data"},@{$info{$_}}[$index3]) } @
+keys;
What I want to do is migrate to including the Tr() method call in the map so I can print say @rows and have it do a Tr per %key for instance. Or maybe even a whole table, whatever, you get it. Thing is I got errors for an undeclared hash when I tried this and simply changing my code to say %cells where it had @cells did not work because ??? I can't just print \%cells ??? .
My question: How do I migrate from this arrayref to a hash ref? Or, alternately what is it that I fail to grok about this (as my question may be irrelevant to my problem)?
TIA
jg
_____________________________________________________Think a race on a horse on a ball with a fish! TG
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.