# usage: readConfig("filename") # returns: num. of parameters set sub readConfig { my $filename=shift; my $i=0; if(open(CONF, $filename)) { while(<CONF>) { if(/^\s*(\S+)\s*=\s*([^(#*|\s*)]+)/) { $$1=$2; ++$i; } } return($i); } else { return(0); } }
In reply to RE: Config file parser
by kop
in thread Config file parser
by ishamael
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |