Thanks, repson - is just what I was looking for.   8^)
Working code + markup below.
    cheers,
    Don
    striving for Perl Adept
    (it's pronounced "why-bick")


(template.pl)

#!/usr/bin/perl -wT use strict; use HTML::Template; use HTML::Entities; use CGI qw(:all); # use CGI::Pretty qw(:all); use CGI::Carp qw(fatalsToBrowser); # debugging only - for production +"use CGI::Carp;" use Time::localtime; use File::stat; use vars qw(@urlsA @urlsB); my $code = 'template.pl'; my $tmpl = 'template.tmpl'; my $template = HTML::Template->new(filename => "$tmpl"); my %urlhashA = ( 'home' => '/', 'sitedocs' => '/doc/', ); my %urlhashB = ( 'Perl Monks' => 'http://www.perlmonks.org/', 'CPAN' => 'http://search.cpan.org/', 'Google' => 'http://www.google.com/', 'Cisco' => 'http://www.cisco.com/', ); while (my ($name,$url) = each %urlhashA) { push @urlsA, { nameA => $name, urlA => $url, } } $template->param(urlloopA => \@urlsA); while (my ($name,$url) = each %urlhashB) { push @urlsB, { nameB => $name, urlB => $url, } } $template->param(urlloopB => \@urlsB); $template-> param( codemod => ctime(stat($code)-> mtime), tmplmod => ctime(stat($tmpl) -> mtime), servname => $ENV{'SERVER_NAME'}, ); print header, $template->output;


(template.tmpl)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE><!-- tmpl_var name=servname --></TITLE> </HEAD> <BODY> <!-- tmpl_loop name="urlloopA" --> <A HREF="<!-- tmpl_var name="urlA" -->"> <B><!-- tmpl_var name="nameA" --></B> </A> &nbsp;&nbsp;&nbsp; <!-- /tmpl_loop --> <P> <!-- tmpl_loop name="urlloopB" --> <A HREF="<!-- tmpl_var name="urlB" -->"> <!-- tmpl_var name="nameB" --> </A> <BR> <!-- /tmpl_loop --> <P> Code update <!-- tmpl_var name=codemod --> <BR> Template update <!-- tmpl_var name=tmplmod --> </BODY> </HTML>

In reply to Re: (2) HTML::Template and hash o' links+labels (Graci) by ybiC
in thread HTML::Template and hash o' links+labels by ybiC

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.