I use Perl to run kpcli, command-line interface to Keepass: http://kpcli.sourceforge.net/. It requires several non-standard modules that can be installed from CPAN. I want to have an USB stick containing a standalone Perl interpreter for both x86 and x86_64 systems, all modules required to run kpcli and kpcli code itself. I want to carry this USB stick around in case I found myself in the situation I need to run kpcli on someone else's machine, a machine without Perl installed or a newly installed system in order to gain access to my password protected Git repository with all config files. But this question is not going to about how to achieve my goal but whether the way I did it is the best and what are the potential pitfalls. What I did is:
- I downloaded Perl source code
- I installed it to ~/perl-install on my PC
- I used ~/perl-install/bin/perl to install all modules required by kpcli using -MCPAN. They were installed to ~/perl-install directory
- I copied a whole ~/perl-install directory to my USB stick
- I plugged an USB stick to another machine and set PERL5LIB to a directory on USB stick like this:
$ export PERL5LIB=$PWD/lib/5.22.0/:$PWD/lib/site_perl/5.22.0/i686-linux:$PWD/lib/site_perl/5.22.0:$PWD/lib/5.22.0/i686-linux
- I run bin/perl kpcli from the USB stick
I compiled and copied a Perl interpreter for both x86 and x86_64 systems because there are some systems such as Slackware that cannot run x86 binaries x86_64 systems out of the box. Is it a good way?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.