in reply to Install CPAN module to another perl version
To install, this ought to work /path/to/perl/bin/cpan Module Module
To install, this ought to work /opt/perl-version/bin/cpan Module Module
To run your program you can use /opt/perl-version/bin/perl program.pl
Or have as your shebang (first line in your file) #!/opt/perl-version/bin/perl -- then you can run the file like by typing /path/to/your/file.pl or ./file.pl
Or prepend these dirs to your $PATH (this program will print them, you export in your shell or .bashrc/.profile as shown below)
#!/opt/perl-version/bin/perl -- use Config; for my $bin( @Config{qw/ sitebin vendorbin bin/} ){ $seen{$bin}++ or print $bin; } } __END__ export $PATH=/opt/perl-version/bin;...;...;...;$PATH
then perl yourprogram.pl runs /opt/perl-version/bin/perl yourprogram.pl
then a shebang of #!/usr/bin/env perl -- runs /opt/perl-version/bin/perl yourprogram.pl
Running your code from shell is discussed in the following Behind the GUI lives the Shell and perlintro / perlrun and UNIX Man Pages env, export
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Install CPAN module to another perl version
by Martin90 (Sexton) on Aug 14, 2014 at 21:36 UTC | |
by Anonymous Monk on Aug 14, 2014 at 21:57 UTC | |
by Martin90 (Sexton) on Aug 15, 2014 at 11:58 UTC |