Update to Update: Life would have been much easier if I'd read the Template VMethods documentation. If you're having problems: STOP, go there, read.
Update: Figured it out, OQ and solution follow. Editorial comments on the Perl and TT would be welcome.

my head hurts. I'm having a serious grok failure in working with Template
Given this Data::Dumper output from within my .tt2 file what would be the TT syntax for access/printing the name and dates from ab and ac?

$VAR1 = { '20120317' => { 'sort_date' => 20120317, 'file_base' => 'Brew_Pub_Populaire', 'stoker' => 'Tom Organizer', 'date' => 'March 17', 'name' => 'Brew Pub Populaire', 'dist' => '100', 'email' => 'otherrider@example.com', 'cred' => 'RUSA', 'start' => 'Cornelius Pass Roadhouse' }, '20120331' => { 'sort_date' => 20120331, 'file_base' => 'Molalla_Foothills', 'stoker' => 'Michael Fastrider', 'date' => 'March 31', 'name' => 'Molalla Foothills', 'dist' => '200', 'email' => 'cyclo@example.com', 'cred' => 'ACP', 'start' => 'Canby, OR' } };
Update: Figured it out (many thanks to Date::Dumper!)
[% FOREACH brevet = brevets %] brevet.key [% brevet.key %] brevet.val [% brevet.value %] brevet.val.name [% brevet.value.name %] brevet.val.date [% brevet.value.date %] brevet.val.dist [% brevet.value.dist %] brevet.val.start [% brevet.value.start %] brevet.val.stoker [% brevet.value.stoker %] [% END %]

For the curious, the Perl that calls TT is something like:

my %tt_food; foreach my $key ( sort { $brevet_config{$a}{sort_date} <=> $brevet_con +fig{$b}{sort_date} } keys %brevet_config ) { $tt_food{$brevet_config{$key}{sort_date}} = $brevet_config{$key}; } my $vars = { brevets => \%tt_food, }; $template->process( 'schedule.tt2', $vars ) or die $template->error();

note: Several updates as I worked through it.


Be Appropriate && Follow Your Curiosity

In reply to Accessing hash of hash elements in Template Toolkit by mikeraz

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.