xorc
public text v1 · immutable#!/usr/bin/perl
sub parseconfig {
($file) = @_;
open (CONFIG,$file) unless (-z $file);
while ($config = <CONFIG>) {
chomp $config;
($key, $valueCon) = split(':',$config);
print "Key: $key\n";
print "Values:";
@valueArr = split(/ /,$valueCon);
foreach(@valueArr) {
print "$_\n";
}
}
close(CONFIG);
}
parseconfig('bla.conf');