4 Einträge, 1 Seite |
1 2 3 4 5 6 7 8
use strict; [...] while(<CONFIG>) { if(! (/^[\#;]/ || /^\s*$/)) { /^\s*(\S*)\s*=?\s*(.*?)\s*$/; our $$1 = $2; }
Quote# Kommentar
#
item1 = hallo_welt
item2 = hallo, das ist ein test
Quote(F) Only hard references are allowed by "strict refs".
QuoteCan't declare scalar dereference in my at ./config.pl line 21, near "$1 ="
1
2
3
4
5
6
7
8
9
my %CFG;
...
while(<CONFIG>) {
next if (/^\s*(#.*)?$/);
my ($key, $value) = split(/[\s\t]*=[\s\t]*/);
$CFG{$key} = $value;
}
4 Einträge, 1 Seite |