If you try to run a Perl Script Executable ( with the default perl installed on puppy linux systems ) which requires any CPAN library modules, that you haven't installed, then you will get an error message that starts with something like the following:
Can't locate MODNAME/Submod.pm in @INC (@INC contains: ...
The solution to this is very simple:
install a portable, fully self-contained copy of perl first, into your home directory ( internet connection required first ):
Code: Select all
curl -fsSL https://git.io/perl-install | bash -s ~/perl
This installs the latest relocatable perl to ~/perl.
Output:
Code: Select all
Installing perl 5.36.0.0 to /root/perl, this may take a while...
Successfully installed perl 5.36.0.0.
To use this perl, add the following line to ~/.bash_profile or ~/.zshrc:
export PATH=/root/perl/bin:$PATH
Now, use the following commands:
Code: Select all
echo 'export PATH=/root/perl/bin:$PATH' >> ~/.bashrc
tail ~/.bashrc
Alternatively, use geany to add it :
geany ~/.bashrc
After installing portable perl, start a new terminal window, and then:
Code: Select all
~# which perl
/root/perl/bin/perl
Also, I will give you the steps to install a Very Useful Perl Script Executable, called parallel, which runs commands parallely, on multiple processors, multiple servers/systems etc.
Google search for GNU Parallel to know more about this utility.
The installation of this utility on puppy linux, using the package manager, gives us a much older version.
Secondly, using it fails with the following error:
Code: Select all
~# which parallel
/usr/bin/parallel
~# parallel --version
Can't locate IPC/Open3.pm in @INC (you may need to install the IPC::Open3 module)
cpan required for installing perl modules was missing as well
~# file /usr/bin/parallel
parallel: Perl script text executable
After installing portable perl with the steps above:
Code: Select all
~# which perl
/root/perl/bin/perl
~# parallel --version
GNU parallel 20161222
Then download the latest Community maintained package for GNU Parallel for your OS from here: https://www.gnu.org/software/parallel/
Debian Unstable Package works fine on the Puppy Linux ( tested on Bionicpup 64 )
Then extract the parallel*.deb file or else
use the portable parallel utility ( that i am attaching here ) to /root and
then cd to its usr/bin folder and then try a sample parallel command:
Code: Select all
# the below commands are run from a pen drive, i.e. sdc1 in this case for portability purposes
cd /mnt/sdc1/parallel_utility/usr/bin
find . -maxdepth 1 -iname "*.sh" -print0 | ./parallel -0 "sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/\"/\"/g; s/'\"'\"'/\'/g' {} > {}_Html_Passed.txt"
ls -ltr
Explanation:
Code: Select all
The above sed command reads each file, performs multiple substitutions of html sensitive/special characters,
parallely with the help of the parallel command and writes them to a corresponding new output file.
Also note that double quotes inside the sed command need to be escaped with a \ as the
parallel command itself needs them.
The find command's -maxdepth value can be adjusted to our needs.
This code will also help those who want to publish their scripts of any kind, on their websites,
without getting them affected by the browser's rendering of it. Also, using the pre tags of html
to surround their scripts will help.
Also:
Code: Select all
./parallel --version
GNU parallel 20220522
The parallel bin folder contains a sample shell script to test.
Hope this post helps for solving errors related to Perl Executables and for installing and trying out new ones.