develooper Front page | perl.perl5.porters | Postings from October 2018

[perl #133558] perl 5.26: use lib pragma issue in IBM AIX

Thread Previous | Thread Next
James E Keenan via RT
October 5, 2018 03:08
[perl #133558] perl 5.26: use lib pragma issue in IBM AIX
Message ID:
On Thu, 04 Oct 2018 11:28:40 GMT, wrote:
>  perl 5.26  use lib pragma is not working in IBM AIX
> use lib "<DIRPATH>";
> Above code snippet fails to append the  DIRPATH to perl INC.
> Because of which perl is not able to load modules in aix

I have never used AIX, but unless something is *very* different there I do not think you are correct.

The syntax 'use lib "<DIRPATH>";' only makes sense to me if you have a directory whose name is, literally, '<DIRPATH>' beneath the current working directory.  But if you have such a directory, and if it contains a Perl module, and if your Perl program is written correctly, then the module found in that directory can be use-d and its subroutines invoked.

I suspect, however, that what the string '<DIRPATH>' means to you is a system-wide environmental variable holding a value for a special directory.  A properly written Perl program can handle that as well.  Consider:

$> cd /tmp
$> mkdir '<DIRPATH>' # quotes needed because '<' is a shell metacharacter
$> mkdir system_dirpath
$> export DIRPATH=system_dirpath
$> echo $DIRPATH

Now, place attachment in directory '<DIRPATH>'.  Place attachment in directory system_dirpath.  Place program in the current directory and run.

$ perl 

Hello world

Goodbye world

Thank you very much.
James E Keenan (

via perlbug:  queue: perl5 status: new

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About