Hello,

I am really struggling to extract the correct information in perl templates. A Dumper file is below and I simply want to extract the value of the e2eventname key but I can't. The whole array of hashes thing is melting my brain!
I have tried the loop below (and many other variations) but no joy.

[% FOREACH element IN e2event %] [% element.e2eventname %] [% END %]
Would anyone know?
$VAR1 = { 'e2event' => [ { 'e2eventprovidername' => 'XYT', 'e2eventdescription' => 'All the latest football news.', 'e2eventstart' => '1315919400', 'e2eventservicename' => '103 - XYT', 'e2eventcurrenttime' => '1315922112.7', 'e2eventremaining' => '588', 'e2eventname' => 'The Football Show', 'e2eventtitle' => 'The Football Show', 'e2eventduration' => '3300', 'e2eventid' => '1237', 'e2eventservicereference' => '1:0:1:2585:7FB:2:11A0000:0:0:0::103 - XY +T' }, { 'e2eventprovidername' => 'XYT', 'e2eventdescription' => 'All the new shows. 'e2eventstart' => '1315922700', 'e2eventservicename' => '103 - XYT', 'e2eventcurrenttime' => '1315922112.99', 'e2eventremaining' => '1800', 'e2eventname' => 'News', 'e2eventtitle' => 'News', 'e2eventduration' => '1800', 'e2eventid' => '1657', 'e2eventservicereference' => '1:0:1:2585:7FB:2:11A0000:0:0:0::103 - XY +T' } ] };


In reply to Templates and hash arrays? by packetstormer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.