Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This modules can I use in the Linux perl

use XML::CanonicalizeXML use XML::XPath use XML::XPath::XMLParser use Crypt::OpenSSL::RSA

Replies are listed 'Best First'.
Re: Can I use the Following Modules in the Linux version of Perl.
by marto (Cardinal) on May 03, 2022 at 09:38 UTC

    They all have passing builds, for example XML::XPath.

      I haven't understood your comment. So can you please tell me that can i use or not in the Linux

        You have to install the modules, but you can use them on Linux.

        If you don't know how to install the modules or if you are using the Perl that comes with your system, most likely your system administrator can install the modules from the system package manager. This is the recommended way of installing modules in that situation.

        If you manage the Perl installation yourself (using App::perlbrew for example), then you simply install the modules using

        cpan XML::CanonicalizeXML XML::XPath XML::XPath::XMLParser Crypt::Open +SSL::RSA

        Most likely you still need your system administrator to install the appropriate external libraries like libxml-dev etc.

        They all have passing builds and can be installed without issue, so you can use them.

Re: Can I use the Following Modules in the Linux version of Perl.
by Anonymous Monk on May 03, 2022 at 16:23 UTC

    I have XML::XPath and XML::XPath::XMLParser installed on my Raspberry PI. uname identifies the OS as armv7l GNU/Linux. I do not use the other two modules.

    Now, I run a custom-built Perl and installed these using the CPAN client. If you are using the system Perl, you will either have to figure out which OS packages to install (if they are in fact available), or figure out how to make a local::lib installation.

    When I tried XML::CanonicalizeXML, it failed for a missing library. This does not mean it can not be done, it just means I need to figure out what else needs to be installed to support it. Crypt::OpenSSL::RSA pulled in a few other modules, but tested successfully on my Raspberry PI, meaning that it could be installed and used.

    Summary of my personal experience:

    • XML::CanonicalizeXML - No relevant experience;
    • XML::XPath - Yes;
    • XML::XPath::XMLParser - Yes;
    • Crypt::OpenSSL::RSA - Almost certainly yes.

    Note that XML::XPath::XMLParser is part of the XML-XPath distribution. If you can get XML::XPath, you should get XML::XPath::XMLParser along with it.

Re: Can I use the Following Modules in the Linux version of Perl.
by cavac (Prior) on May 06, 2022 at 13:30 UTC

    Ok, all seems to work here on my Linux distro Xubuntu 20.04:

    • XML::CanonicalizeXML
      sudo apt install libxml2-dev cpan XML::CanonicalizeXML
    • XML::XPath (this also installs XML::XPath::XMLParser i think)
      cpan XML::XPath
    • Crypt::OpenSSL::RSA
      cpan Crypt::OpenSSL::RSA

    There may be additional dependencies/libraries you have to install in your Linux distro. I've tested this on my office dev machine, on which i already have a huge amount of stuff installed.

    perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'
Re: Can I use the Following Modules in the Linux version of Perl.
by perlfan (Parson) on May 03, 2022 at 17:21 UTC
    TLDR; without knowing more, I say your chances of modules working across OSes with perl are HIGH.

    It's rather rare that you have a module that will not work with the version of perl at your disposal; this is one of the great things about perl. Where things get tricky are modules that depend on compiled libraries that are generally shipped on modern BSD/Linux that tend to be security related and thus are updated frequently, like OpenSSL.