Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Delete/Reinstall Perl

by oldcity (Novice)
on Jun 03, 2013 at 00:55 UTC ( [id://1036638]=perlquestion: print w/replies, xml ) Need Help??

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

Had need to reinstall Ubuntu 12.04. Have Perl programs I have used for a very long time. They use the libdate-calc-perl for Date::Format and Date::Calc apparnatly. Synaptic shows libdate-calc-perl to be installed.

When I run the program I get the following:

Can't locate Date/Format.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at GasProg line 9. BEGIN failed--compilation aborted at GasProg line 9.

Date/Format.pm is not present. Should be in /usr/share/perl5.

The program runs fine on another machine.

I compared items in directory items and found many items missing in the following items: /usr/share/perl5 /usr/local/share/perl/5.14.2 (No such file or directory) /usr/lib/perl5 /usr/share/perl5

Would it be wise to remove perl and later do a fresh install?

Replies are listed 'Best First'.
Re: Delete/Reinstall Perl
by rjt (Curate) on Jun 03, 2013 at 01:08 UTC

    I wouldn't recommend trying to remove the base Ubuntu Perl. It is used extensively by the system and many other software packages that are part of the base installation.

    Unfortunately, I don't think current Ubuntu has a package for Date::Format (it would be called libdate-format-perl)

    My recommendation would be to use CPAN (or http://cpanmin.us), and possibly install your own Perl via Perlbrew. This last step is not strictly necessary, but the Ubuntu base Perl tends to lag behind a few versions. Perlbrew is careful not to interfere with the base Perl on the system.

Re: Delete/Reinstall Perl
by sundialsvc4 (Abbot) on Jun 03, 2013 at 13:33 UTC

    You should be able to resolve this problem, without Draconian action, once you fully understand it.

    Use the set command to list the environment-variables, and see if PERL5LIB is among them, and if so, what does it say.   It should be a list of directories, separated by colon : characters.

    Try cat ~/.bash_profile (notice the period ...) and see if it contains commands to set a value to that variable.   If so, type the same command again, minus the word cat, and try again what you did before.   If that throws an error, try substituting source for cat.   Or, log off and on again.

    Try locate Format\.pm to see if the file is (or was ...) anywhere at all, and if so, where.

    If you are using packages to maintain your system, try force-reinstalling the package that contains the module that you seek.

    A convenient “one-liner” for checking if a module exists is: perl -MDate::Format -e '0;' ... or if you prefer ... perl -e 'use Date::Format;' ... in both cases using single quotes.

    The command, perl -V, with a capital V, will produce a lot of information including the current and complete set of directories that will be searched (in order) to find any module.   It takes into account the $PERL5LIB setting along with everything else.

      After much thought and re installs of Ubuntu 12.04.2 I compared installed perl items from my laptop that the perl programs worked to the 12.04.2 install and found a number of missing lib functions missing. I installed the some 35 items and lo and behold the programs worked. I would be happy to furnish the list of missing lib items. oldcity13

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1036638]
Approved by Old_Gray_Bear
Front-paged by davido
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-19 22:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found