Comments (4)
I can't speak for others, but I don't think using plenv for such purposes is a good thing to do.
I use plenv for personal perl copies -- i.e. my Mac that I use everyday, I use plenv so I can switch around versions when necessary.
But for deployed apps, I never use plenv. Instead I use something like xbuild or Perl::Build and stick to that version until I manually decide to upgrade.
from plenv.
I'm interested in this discussion because I had a vaguely similar use case in mind.
I was hoping to run a Plack-served app through a plenv
-provided Perl as a regular (but purpose-made) user on a Debian system, started by a Daemon::Control-prepared init script at system boot.
Everything works fine when run from that user's shell, because obviously the environment provides the means to pick out the right Perl.
At the init
level though, the system Perl is run and none of the dependencies are available, so nothing starts.
There doesn't seem to be an easy fix to this. Is the only solution to prepare a Perl exclusively for that web app (probably using Perl::Build
) and then hard-code all of the web app's scripts to use that Perl (which would have the effect of tightly coupling the two)?
Thanks in advance for any pointers.
from plenv.
In real life we often have a wrapper script that wraps any command we execute:
./scripts/env.sh ./scripts/foo.pl
and in that script we do something similar to
export PATH="/path/to/perl-that-we-should-use-for-this-project:$PATH"
export PERL5LIB="/path/to/project/local/lib/perl5:/path/to/project/lib"
...
exec "$@"
Then your shebangs just need to be
#!/usr/bin/env perl
or something similar
from plenv.
That sounds like exactly what I need in my case: make the code "Perl-agnostic" (for lack of a better term), and make whoever runs it responsible for making the environment point to the right Perl. No plenv
required, and everything is nicely decoupled. Thanks very much for your insight.
from plenv.
Related Issues (20)
- "man perl" shows system Perl manual under local Perl dir (.perl-version) HOT 3
- homebrew plenv v2.3.0 is claiming it is 2.2.0 HOT 1
- Homebrew shows incorrect plenv versioning HOT 1
- no backend configured for scheme https HOT 7
- Plenv to control additional Perl lib paths (PERL5LIB env var?) HOT 7
- Complain about active local::lib in ~/perl5
- plenv install fails with "newer" Perls HOT 3
- failure when attempting to install any Perl version on macOS Big Sur HOT 8
- Separate GitHub Organization for plenv
- Use plenv-rehash to install the hooks from plugins
- How to use with wayland? HOT 2
- Respect .perl-version through symlinks?
- No problem to install-cpanm, but failed to find cpanm command HOT 6
- Thank you - seems to work in ksh93 HOT 1
- plenv should update MANPATH so that man pages installed in a plenv-managed Perl are found HOT 5
- install-cpanm Fails: ERROR: Cannot find the tarball for perl-cpanm HOT 2
- mxcl. in link
- plenv: no such command `shell'
- To support environments except bash/zsh( such as csh)
- `plenv migrate-modules` may break List::Util(and cpanm)
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 plenv.