B
Bernd Fischer
Hi,
I have a config file with a key value pair
KEY = VALUE
which I read in with
while ( <CONFIG> ) {
chomp; # no newline
s/#.*//; # no comment
s/^\s+//; # no leading withespaces
s/\s+$//; # no ending withespaces
next unless length; # unless something to read
( $var, $value ) = split( /\s*=\s*/, $_, 2 );
$preferences{ $var } = $value;
}
I'm now looking for a solution to read something like
KEY = VALUE1 VALUE2 VALUE3 \
VALUE4 VALUE5
How to modify the regular expressions to accept '\' as a
intentionally linebreak character?
Thanks Bernd
I have a config file with a key value pair
KEY = VALUE
which I read in with
while ( <CONFIG> ) {
chomp; # no newline
s/#.*//; # no comment
s/^\s+//; # no leading withespaces
s/\s+$//; # no ending withespaces
next unless length; # unless something to read
( $var, $value ) = split( /\s*=\s*/, $_, 2 );
$preferences{ $var } = $value;
}
I'm now looking for a solution to read something like
KEY = VALUE1 VALUE2 VALUE3 \
VALUE4 VALUE5
How to modify the regular expressions to accept '\' as a
intentionally linebreak character?
Thanks Bernd