Line 78: |
Line 78: |
| | | |
| Dear {$title} {$lastname}, | | Dear {$title} {$lastname}, |
− | | + | |
| It has come to our attention that you are delinquent in your | | It has come to our attention that you are delinquent in your |
| {$monthname[$last_paid_month]} payment. Please remit | | {$monthname[$last_paid_month]} payment. Please remit |
| ${sprintf("%.2f", $amount)} immediately, or your patellae may | | ${sprintf("%.2f", $amount)} immediately, or your patellae may |
| be needlessly endangered. | | be needlessly endangered. |
− | | + | |
| Love, | | Love, |
− | | + | |
| Mark "Vizopteryx" Dominus | | Mark "Vizopteryx" Dominus |
| | | |
Line 91: |
Line 91: |
| | | |
| Dear Mr. Gates, | | Dear Mr. Gates, |
− | | + | |
| It has come to our attention that you are delinquent in your | | It has come to our attention that you are delinquent in your |
| February payment. Please remit | | February payment. Please remit |
| $392.12 immediately, or your patellae may | | $392.12 immediately, or your patellae may |
| be needlessly endangered. | | be needlessly endangered. |
− | | + | |
| Love, | | Love, |
− | | + | |
| Mark "Vizopteryx" Dominus | | Mark "Vizopteryx" Dominus |
| | | |
Line 104: |
Line 104: |
| | | |
| use Text::Template; | | use Text::Template; |
− | | + | |
| my $template = Text::Template->new(SOURCE => ’formletter.tmpl’) | | my $template = Text::Template->new(SOURCE => ’formletter.tmpl’) |
| or die "Couldn’t construct template: $Text::Template::ERROR"; | | or die "Couldn’t construct template: $Text::Template::ERROR"; |
− | | + | |
| my @monthname = qw(January February March April May June | | my @monthname = qw(January February March April May June |
| July August September October November December); | | July August September October November December); |
Line 117: |
Line 117: |
| monthname => \@monthname, | | monthname => \@monthname, |
| ); | | ); |
− | | + | |
| my $result = $template->fill_in(HASH => \%vars); | | my $result = $template->fill_in(HASH => \%vars); |
− | | + | |
| if (defined $result) { print $result } | | if (defined $result) { print $result } |
| else { die "Couldn’t fill in template: $Text::Template::ERROR" } | | else { die "Couldn’t fill in template: $Text::Template::ERROR" } |