All pastes #36579 Raw Edit

xorc

public text v1 · immutable
#36579 ·published 2006-01-12 11:55 UTC
rendered paste body
#!/usr/bin/perl

use Data::Dumper;
print Dumper(%file_attachments);

my %config;

sub parseconfig {

        ($file) = @_;
        open (CONFIG,$file) unless (-z $file);

        $x=0;
        while ($config = <CONFIG>) {
                ($key, $value) = split(' : ',$config);
                chomp($value);

                print "$key => $value\n\n";
                $config{$key} = $value unless defined;
        }
        close(CONFIG);
}

parseconfig('bla.conf');

print "\n\n\n\n-------------------------------------------------------------";

print "\n".$config{'var1'} ."\n";
print "\n".$config{'var2'} ."\n";
print "\n".$config{'var3'} ."\n";
print "\n".$config{'var4'} ."\n";

print "-------------------------------------------------------------\n\n\n\n";

print Dumper(%config);