Kind of trivial here, but what this will do is make the output much easier to understand and modify in the future. (For larger future projects, be sure to investigate things like Template::Toolkit or HTML::Template)printf 'Certification is %s on %02d % 02d %d<p><HR>', $certification, $month, $day, $year;
for (my $i=1; $i<=$lines; $i++) { my $certification = shift(@data); my $number = shift (@data); my $month = $mon [$number-1]; my $day = shift (@data); my $year = shift(@data); # printf .... }
Note that it's still dependent on the file format being sets of 4 lines ..while(@data){ ... }
use Date::Calc qw/Month_to_Text/; while(@data){ ... my $number = shift (@data); my $month = Month_to_Text($number); ... }
In reply to Re: Change number into month
by davidrw
in thread Change number into month
by loop362
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |