#927031 perl: unfeasible default search path

Package:
perl
Source:
perl
Description:
Larry Wall's Practical Extraction and Report Language
Submitter:
Winfried Boxleitner
Date:
2020-11-14 23:24:02 UTC
Severity:
normal
#927031#5
Date:
2019-04-13 21:55:42 UTC
From:
To:
Dear Maintainer,

backuppc, a perl program does not start
(related bugs: #855617 and #856504)


error message:
"Can't locate strict.pm:   /usr/local/lib/x86_64-linux-gnu/perl/5.28.1/strict.pm: Permission denied at /usr/share/backuppc/lib/realindex.cgi line 48"
searching the internet (see: https://stackoverflow.com/questions/2526804/how-is-perls-inc-constructed-aka-what-are-all-the-ways-of-affecting-where-pe)
showed the reason: the search path included directories, which did not
exist or were not searchable by user "backuppc".

searching the include path shows:
perl -e 'print join "\n", @INC'
NOT sufficient, that the directory exists, it must be searchable
by the user starting the perl script. The directories under /usr/local
may be empty, but MUST exist. This is especially annoying because
the search path contains versioned directories, eg. .../perl/5.28.1/.

Workaround:
  the include path @INC is a compiled-in default, but can be prepended
  with a list of directories by setting the env-variable PERL5LIB.
  therefore list all system dirs, so the ones under /usr/local are NEVER touched
  PERL5LIB=/etc/perl:/usr/lib/x86_64-linux-gnu/perl5/5.28:/usr/share/perl5:/usr/lib/x86_64-linux-gnu/perl/5.28:/usr/share/perl/5.28:/usr/lib/x86_64-linux-gnu/perl-base