Comments (4)
I looked at this issue intently for a few days. The only way that I found to fix it is nothing more than a workaround; fire off perlbrew and replace the shell with exec so that the environment changes are preserved.
from app-perlbrew.
It does not seem to be possible to preserve $PATH
without an exec bash
after your bash script finished.
perlbrew switch
should update your $HOME/.perlbrew/init
file with new values. A newly invoked shell should be able to read those values again.
Basically, a source $HOME/.perlbrew/init
right after your bash script finished should be sufficient. But you'll need to do it outside of your bash script.
from app-perlbrew.
@mrmuskrat, correct me if I'm understanding it wrong, are you trying to run "perlbrew use perl-5.12.2" inside your bash script ? If so, you will need to source
the provided bashrc first.
If you did that and the problem remains, I suggest you to upgrade to at lease version 0.22, which, I believe, is a much robust version in terms of bash integration.
Let me know if upgrading works, or let's discuss your use case and maybe craete a Howto document for it :)
from app-perlbrew.
Just a quick not here. In the next release, to be above to perform perlbrew function in a shell script, 3 lines should be included in advance in the script:
export PERLBREW_ROOT=/opt/perlbrew
export PERLBREW_HOME=/tmp/.perlbrew
. ${PERLBREW_ROOT}/etc/bashrc
After that, perlbrew use
and perlbrew switch
can correctly alter $PATH in the shell script. This should also make it friendlier to be invoked from crontab.
However I still have no idea how to implement a csh counter-part. Leaving that as an exercise :)
I will write an brief article about this improvement in the next release note, therefore I am closing this issue now.
from app-perlbrew.
Related Issues (20)
- Site install.perlbrew.pl is not responding HOT 5
- Unable to switch to new perl installation HOT 4
- Can't install stable on MacOS Monterey 12.6.1
- Cannot manage libs with Apache2
- Install fail on OSX 12.6.2 HOT 6
- Feature Request: an option to "install" to uninstall first.
- cpan: install a module, then perl search @INC system wide HOT 2
- Can't install Perl on macOS 13.3 M2 HOT 4
- Manage Perl modules with "Universal Binary" (e.g. arm64, x86_64) HOT 8
- Building and testing Tk-804.036 ... FAIL
- Install of perl5.38.0 fails on OS/X Bigsur
- Preventing Compress::Raw::Zlib From Installing "private" Version of Zlib HOT 1
- `perlbrew install` searches for .bz2 tarballs no longer on CPAN HOT 3
- patchperl requires 'deprecate' module missing on AlmaLinux9 HOT 4
- self-upgrade failure
- Cannot import modules with `cpm`: `install-cpm` vs `install-cpanm` commands HOT 7
- Alternate $PERLBREW_ROOT not being set in $PERLBREW_ROOT/etc/cshrc
- Can not install perl if there is no perl HOT 1
- curl silently fails if `~/perl5/perlbrew/dists` does not exist HOT 1
- Rewriting existing tests using Test2 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from app-perlbrew.