previous | top | next |
#!/usr/bin/perl package HashFromFile; sub make { my ($class, %args) = @_; my $file = $args{filename}; my $hash = {}; open(FH, "< $file"); while (my $line = <FH>) { if ($line =~ /^\s+$/) { next; } chomp($line); my ($key, $value) = split(/:/, $line); $hash->{$key} = $value; } close(FH); return $hash; } 1;
Email: bschmaus@combinenet.com |