Hi,
use strict;
[...]
while(<CONFIG>) {
if(! (/^[\#;]/ || /^\s*$/)) {
/^\s*(\S*)\s*=?\s*(.*?)\s*$/;
our $$1 = $2;
}
Liest eine Configurationsdatei ein die etwa so aussieht:
Code:
Quote# Kommentar
#
item1 = hallo_welt
item2 = hallo, das ist ein test
item1 soll der Name des Scalar werden und
hallo_welt der Wert. Leider geht das nicht so leicht wie ich mir das vorgestellt hab...
Quote(F) Only hard references are allowed by "strict refs".
Ist die Fehlermeldung. Also hab ich es mit no strict 'refs' versucht, aber da bekomme ich
QuoteCan't declare scalar dereference in my at ./config.pl line 21, near "$1 ="
...
Jemand ne Idee wie ich noch an das Problem rangehen kann?
by, Martin