0

I've created a perl script that fetch string/s and output as a file to be loaded on our database.

Now, i'm using Solaris 5.10 to run the perl script but there's an error and i think it's referring for the module.

Sample Perl Script:

#!/usr/bin/perl
use strict;
use warnings;
use Date::Simple ('date','today');

my $date_increment;

.....

Error:

Can't locate Date/Simple.pm in @INC (@INC contains: /usr/perl5/5.8.4/lib/i86pc-solaris-64int /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4/i86pc-solaris-64int /usr/perl5/site_perl/5.8.4 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .) at ./sqa_perl.pl line 4.

Is there any module that I need to install? Or is there any location of perl modules in Solaris 5.10?

2

Yes : you definitely need the "Date::Simple" module somewhere.

The paths your perl is looking into are mentioned in the error message:

/usr/perl5/5.8.4/lib/i86pc-solaris-64int
/usr/perl5/5.8.4/lib
/usr/perl5/site_perl/5.8.4/i86pc-solaris-64int 
/usr/perl5/site_perl/5.8.4
/usr/perl5/site_perl
/usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int
/usr/perl5/vendor_perl/5.8.4
/usr/perl5/vendor_perl
.


As mentioned by Andrew, it might be better not to simply add it into your /usr, which also mean you will have to add some use lib '/some/path'; in your script.

Here are some ways to do it:

  • Installing this module the old (and simple) way, on the script own local directory:
    (first, get the module installation archive from CPAN)

    tar -zxvf Date-Simple-3.03.tar.gz
    cd Date-Simple-3.03
    PREFIX=/your/script/directory perl Makefile.pl
    make && make install
    

    then modify the beginning of your script to have:

    #!/usr/bin/perl
    use strict;
    use warnings;
    use File::Spec::Functions;
    use FindBin;
    use lib catfile($FindBin::Bin, 'lib');
    ...
    


  • perlbrew can also be a solution, as it is a rather simple way to host your own perl instalation outside the system directories (you might need to search a bit regarding Solaris):


  • If you feel confortable enough regarding your system /usr, you can still use the system perl CPAN tools to install this module:

  • I hope no one follows this answer and installs CPAN modules into /usr/perl5 as root. Instead, set up a module repository outside of the OS-standard directories. Especially if you're paying Oracle for Solaris support - dumping "extras" into /usr will likely violate your service contract. – Andrew Henle Nov 21 '19 at 15:30
  • I am a bit surprise by Oracle behaviour regarding OS support. Do you have any link or reference to such contracts ? – Ouki Nov 22 '19 at 0:16
  • Do you really think Oracle would agree that they are responsible for your system failing if you modify Oracle-supplied parts of the OS? Do you really think Red Hat/IBM would agree that they are responsible for your system failing if you modify any Red Hat/IBM-supplied OS components? If you change it, you own it. No company is going spend its money and its employees' time and effort cleaning up any mess you make. – Andrew Henle Nov 22 '19 at 13:37
  • (cont) If you dump a CPAN Perl module into /usr/perl5, then your network stops working, and you put in an Oracle service call to get Oracle to fix your supported installation, the tech Oracle sends will likely walk out the moment that your Perl module you dumped into /usr/perl5 is found to have broken the network. Count yourself lucky if Oracle doesn't charge you for the tech's time. Any support tech from any company would do the exact same thing unless you have a large support contract or buy a lot from them and they cut you some slack for business purposes. – Andrew Henle Nov 22 '19 at 13:41
  • (cont) How do I know? Because I've been that tech - called in as an outside consultant because a huge customer was having massive network problems. The whole team of us almost all walked out the moment we discovered the customer was disabling autonegotiation on gigE and faster network links. Autonegotiation is a required setting for gigE and faster networks, so we were not going to support anything outside of what the hardware and software were designed for. The only reason we didn't walk out was this was a huge customer. And that was just for operating outside specs. – Andrew Henle Nov 22 '19 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.