From c603325170ce0a8cb8a203aa7aacc74b6587366e Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 11 Sep 2006 23:16:40 +0200 Subject: [PATCH] LiCoM::Config: Read the file `licom.conf' in the script's directory too, if it exists. --- lib/LiCoM/Config.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/LiCoM/Config.pm b/lib/LiCoM/Config.pm index 295f7eb..be8359f 100644 --- a/lib/LiCoM/Config.pm +++ b/lib/LiCoM/Config.pm @@ -4,6 +4,8 @@ use strict; use warnings; use Carp (qw(cluck confess)); +use File::Basename (qw(dirname)); + use Exporter; @LiCoM::Config::EXPORT_OK = (qw(get_config set_config read_config)); @@ -72,6 +74,10 @@ sub read_config { push (@files, $ENV{'HOME'} . '/.licomrc'); } + elsif (defined ($ENV{'SCRIPT_FILENAME'})) + { + push (@files, dirname ($ENV{'SCRIPT_FILENAME'}) . '/licom.conf'); + } for (@files) { -- 2.11.0