/[libconf]/libconf/perl-Libconf/Libconf.pm
ViewVC logotype

Diff of /libconf/perl-Libconf/Libconf.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by dams, Sun Apr 6 18:56:05 2003 UTC revision 1.15 by dams, Sun Apr 13 22:55:41 2003 UTC
# Line 119  my %validation = (); Line 119  my %validation = ();
119  #                                },  #                                },
120  #                );  #                );
121    
122  sub new { readConf(@_) }  sub new {
   
 sub readConf {  
123      my ($pkg, $filename, $template_name, $validation_name) = @_;      my ($pkg, $filename, $template_name, $validation_name) = @_;
124      -e $filename or die ("$filename not found");      -e $filename or die ("$filename not found");
125      eval "require Libconf::templates::$template_name" . '_template';      eval "require Libconf::templates::$template_name" . '_template';
126      my %out;      my %out;
     my @file = cat_($filename);  
127      $out{filename} = $filename;      $out{filename} = $filename;
128      $out{template_name} = $template_name;      $out{template_name} = $template_name;
129      $validation_name and $out{validation_name} = $validation_name;      $validation_name and $out{validation_name} = $validation_name;
130      $out{atoms} = [];      $out{atoms} = [];
131      parse(\%out, \@file);      readConf(\%out);
132      bless \%out, $pkg;      bless \%out, $pkg;
133      \%out;      \%out;
134  }  }
135    
136    sub readConf {
137        my ($out) = @_;
138        my $filename = $out->{filename};
139        -e $filename or die ("$filename not found");
140        my @file = cat_($filename);
141        parse($out, \@file);
142    }
143    
144  sub clear {  sub clear {
145      my ($out) = @_;      my ($out) = @_;
146      $out->{atoms} = [];      $out->{atoms} = [];

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26