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.
Would anyone know?[% FOREACH element IN e2event %] [% element.e2eventname %] [% END %]
$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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |