From: Graham Knop Date: Sat, 4 Feb 2017 06:29:16 +0000 (-0500) Subject: use absolute paths when loading perl files X-Git-Tag: v0.28~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=commitdiff_plain;h=1febe9e798741e52f72d701e4e806e2c30b004e9 use absolute paths when loading perl files The filenames provided to Config::Any are meant to be file paths. If they are relative paths, they should be used directly, not searched for in @INC. Converting them to absolute paths will avoid that search, and will allow it to work as expected when . is not in @INC. --- diff --git a/lib/Config/Any/Perl.pm b/lib/Config/Any/Perl.pm index 28ad0c1..2bddfa1 100644 --- a/lib/Config/Any/Perl.pm +++ b/lib/Config/Any/Perl.pm @@ -4,6 +4,7 @@ use strict; use warnings; use base 'Config::Any::Base'; +use File::Spec; =head1 NAME @@ -48,7 +49,7 @@ sub load { my( $exception, $content ); { local $@; - $content = do $file; + $content = do File::Spec->rel2abs($file); $exception = $@; } die $exception if $exception;