#!/usr/bin/perl -Tw use strict; use CGI qw(:standard); use Date::Calc qw/Month_to_Text/; use Template; my $employee=param('employee_name') || ''; my $filename = "Files/$employee.txt"; open(JOE, "$filename") or die "Couldn't read '$filename': $!"; my @data = <JOE>; close (JOE); my @certs; while(@data){ my %h; @h{ qw/certification month day year/ } = map {chomp; $_} splice(@dat +a,0,4); $h{monthStr} = Month_to_Text($h{month}); push @certs, \%h; } my $data = { employee => $employee, certs => \@certs, }; my $template = Template->new(); print header; # use Data::Dumper; # Use this for debugging # print "<pre>".Dumper($data)."</pre>"; # to see what $data is. $template->process(\*DATA, $data) or die $template->error(); exit; __DATA__ <html> <head> <title>Employee Certifications</title> </head> <body bgcolor="cccccc"> Employee's name is <b>[% employee %]</b><p/> <hr> <p/> [% FOREACH row = certs %] Certification is [% row.certification %] on [% row.monthStr %] [% row. +day %] [% row.year %]<p/> <HR> [% END %] <div align="center"> <table width="120" border="1" cellspacing="2" cellpadding="0"> <tr><td align="center">To go Back</td></tr> <tr><td align="center"><a href="http://hawaiicivilmarriage.com/FFD/">C +lick Here</a></td></tr></table><p></p></div> </body> </html>
In reply to Re: Change number into month
by davidrw
in thread Change number into month
by loop362
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |