sub read_conf { my $self = shift; my $conf_file = shift; local $/ = "\n"; my $conf = Config::ApacheFormat->new(); $conf->read($conf_file); .... } #### Error in config file , line 1: unable to parse line at .... #### perl -MMyPackage -e 'local $/;my $obj = MyPackge->new;$obj->read_conf("/path/to/conffile");'