This code is used in a legacy system, when this method is called, the "read()" throws the following error:
Error in config file , line 1: unable to parse line at ....
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:
perl -MMyPackage -e 'local $/;my $obj = MyPackge->new;$obj->read_conf
+("/path/to/conffile");'
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.