From fc24fffbe2387a811c100e3b15160a86345108af Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Sat, 29 Aug 2020 13:13:21 -0700 Subject: [PATCH] firemod: Attempt to fix INC path issue. On my system that does not have the directory /home/lanforge/scripts, the lf_firemod.pl would fail saying it cannot find Net::Telnet, even though it is installed. The problem turns out to be that if you have "use lib foo" and foo does not exist, or is not readable, then perl craps out immediately instead of trying other places in @INC. I think this 'use if' logic fixes that issue based on internet reading. It fixes the issue on my system, but I'm not certain it works properly on systems that do depend on /home/lanforge/scripts/ existing, so that will need some more testing. Signed-off-by: Ben Greear --- lf_firemod.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lf_firemod.pl b/lf_firemod.pl index 4f27bdca..da4f764d 100755 --- a/lf_firemod.pl +++ b/lf_firemod.pl @@ -18,7 +18,7 @@ $| = 1; # use lib prepends to @INC, so put lower priority first # This is before run-time, so cannot condition this with normal 'if' logic. -use lib '/home/lanforge/scripts'; +use if (-e "/home/lanforge/scripts"), lib => "/home/lanforge/scripts"; use lib "../"; use lib "./";