perlmaven.com | The source files of the Perl Maven articles
kandi X-RAY | perlmaven.com Summary
kandi X-RAY | perlmaven.com Summary
The source files of the Perl Maven articles
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of perlmaven.com
perlmaven.com Key Features
perlmaven.com Examples and Code Snippets
Community Discussions
Trending Discussions on perlmaven.com
QUESTION
I need to convert a 'use' statement in my Perl code to 'require' statement to import some %EXPORT_TAGS from another module. The module that I am "use"ing is a plain .pm file (not a class with constructor).
Below is the snippet of the MyModule.pm file
...ANSWER
Answered 2020-Jul-21 at 15:51The use
statement basically translates to a BEGIN
block with an import
call, where the argument list is passed into import
.
So this would translate to
QUESTION
We are using some custom modules in our Perl automation framework which runs through Jenkin pipeline. Recently we got package not found error for all custom modules while executing test cases in AIX servers as latest Perl version is installed there . So we tried to add "PERL5LIB" in the path as mentioned in document
https://perlmaven.com/how-to-change-inc-to-find-perl-modules-in-non-standard-locations
We added "export PERL5LIB=/home/foobar/code" in /etc/profile of the AIX server and script getting executed without any issue when running from local AIX machine.
Issue:
But we have Jenkin pipeline to execute the scripts in AIX server using ssh. Now when we do SSH to the AIX server in the pipeline script the variables that we have set in /etc/profile does not load and we get package not found error.
Question: How can I load the profile in the AIX server while running it from pipeline? or is there any other way to handle this. Before executing script I want to export PERL5LIB in remote AIX server through pipeline (only once) and the I should not get package not found error.
Below solutions I have tried :
Load the /etc/profile: ssh AIX server ./etc/profile (using dot since source not working in AIX)
Adding this line "export PERL5LIB=/home/foobar/code" in .ssh/environment in AIX server and set PermitUserEnviorment yes
Appreciate any help on this.
...ANSWER
Answered 2020-May-02 at 14:06Assign values to variables the usual way:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install perlmaven.com
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page