No such thing as a small change | |
PerlMonks |
Config::ApacheFormat and $/ strangenessby InfiniteLoop (Hermit) |
on Nov 28, 2006 at 17:11 UTC ( [id://586522]=perlquestion: print w/replies, xml ) | Need Help?? |
InfiniteLoop has asked for the wisdom of the Perl Monks concerning the following question:
Greetings Monks,
I have tried to use Config::ApacheFormat, to parse a apache style conf file, as below
This code is used in a legacy system, when this method is called, the "read()" throws the following error:
Even, though I have localised the $/ and reset it to newline, I get this error. However, I can't duplicate this error anywhere else. Even doing the following, doesn't result in a error:
After reading perlmod, I assumed "local" would modify $/ till the end of the "read_conf()"'s code block. I tried to enclose the local and call to "read()" in a code block, but that didn't work either. Any help in solving this is appreciated. Thanks.
Update:
Adding a: local $/="\n";, in Config::ApacheFormat->_read() seems to solve the problem. However the strange thing is even though I had localized $/ in my method, the value was reset when Config::ApacheFormat->read() was invoked.
Back to
Seekers of Perl Wisdom
|
|