Auth/Template.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 33 CC 2 SCAR 12.0
CC
2
Cov
0%
process
6.0
_init
2.0
BEGIN
2.0
CRAP 3.3
1 # WWW:Auth::Template
2 #
3 # Copyright (c) 2002 Jonathan A. Waxman <jowaxman@law.upenn.edu>
4 # All rights reserved.
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the same terms as Perl itself.
8  
9  
10 package WWW::Auth::Template;
11 use base 'WWW::Auth::Base';
12  
13  
14 use strict;
15 use WWW::Auth::Config;
16  
17  
18 sub _init {
19 my $self = shift;
20 my %params = @_;
21  
22 return 1;
23 }
24  
25 sub process {
26 my $self = shift;
27 my ($template, $vars) = @_;
28  
29 if (! open (TEMPLATE, $template)) {
30 return $self->error ("Error opening template $template: $!");
31 }
32 my $text;
33 while (my $line = <TEMPLATE>) {
34 $line =~ s/\${([^}]+)}/$vars->{$1}/g;
35 $text .= $line;
36 }
37 close (TEMPLATE);
38  
39 print $text;
40  
41 return 1;
42 }
43  
44  
45 1;