Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Windows set PERL5LIB environment variable

by VinsWorldcom (Prior)
on May 06, 2021 at 10:35 UTC ( [id://11132132]=note: print w/replies, xml ) Need Help??


in reply to Windows set PERL5LIB environment variable

Windows doesn't have export so I'm not sure what you're doing. Are you using the perl with Git for Windows and Git bash?

I use Strawberry Perl and set my PERL5LIB in Control Panel => System => Advanced System Settings => Advanced => Environment Variables => User Variables. It is:

C:\Users\Vinsworldcom\perl5\lib\perl

If you want to set it only temporarily in a PowerShell (no one uses CMD.exe anymore these days):

PS VinsWorldcom ~ > $env:PERL5LIB="C:\Users\VinsWorldcom\perl5\lib\per +l5" PS VinsWorldcom ~ > $env:PERL5LIB C:\Users\VinsWorldcom\perl5\lib\perl5

I think you may be messing up syntax. Windows uses colon (:) for drive letters and semicolon (;) for path separators. Bash uses colon (:) for path separators and uses semicolon (;) as command separators. Seems you're trying to use Windows syntax in Bash paths. To set PERL5LIB it in Git bash, don't worry about the drive:

export PERL5LIB=/Users/VinsWorldcom/perl5/lib/perl5

or if you really need the drive letter, I think the following syntax works:

export PERL5LIB=/C/Users/VinsWorldcom/perl5/lib/perl5

Cheers.

Replies are listed 'Best First'.
Re^2: Windows set PERL5LIB environment variable
by vinoth.ree (Monsignor) on May 06, 2021 at 13:06 UTC

    Yes, I have git bash, using git from windows, I am trying to run client side hooks written in perl. Whenever developer commit a code, we run 15 perl scripts separately to make sure the code is followed our coding standard.


    All is well. I learn by answering your questions...

      I understand now, but I think you *may* encounter issues. If your Git Bash is seeing the Git for Windows perl as the Perl to use and you're trying to add PERL5LIB for ActiveState Perl (assumed based on the Windows path I see), you better hope they are the same Perl version or that you're just referencing pure Perl modules in the PERL5LIB path you provide.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11132132]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-03-29 11:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found