Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

I nuked strict.pm. Now postgres don't want to talk to me

by pvaldes (Chaplain)
on Apr 12, 2017 at 15:03 UTC ( #1187776=perlquestion: print w/replies, xml ) Need Help??

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

$ CPAN "There is an upgrade available to cpan" (grreeeat) "Do you want to install it instead using the old version available in +Debian testing?" (whynot?... yup) Hum... this is taking a lot of time and I need to go out. I'll stop it

No good idea remains unpunished. Now all my perl scripts refuse to run sending this message

Can't locate strict.pm in /usr/local/lib/x86_64-linux-gnu/perl/5.24.1/strict.pm Denied permission at myperlscript line 4

Strangely my sql scripts started crashing with exactly the same message; And this is how I discovered that psql is in fact a perl script (awesome!)

I tried to rm cpan and to reinstall cpan two or three times, but the problem is not solved. I'll appreciate any suggestion about how to clean the blood in this train wreck and reboot perl. Thanks

UPDATED: I can run perl scripts as root still (but not psql)

Replies are listed 'Best First'.
Re: I nuked script.pm. Now postgres don't want to talk to me
by davido (Cardinal) on Apr 12, 2017 at 15:22 UTC

      Some notes:

      In order to have the perl commmand working again I had to restore Strict.pm and Tabs.pm (called by diagnostics), chmod o+r them, and restore exec for other (chmod o+x) in several parent directories.

      in order to restore psql I had to reinstall again libsocket-perl to upgrade socket object version, restore Glob.pm, and chmod o+r them

      By now is working and I'm learning, so is a happy end. Revenge against CPAN pending. There is nothing like putting yourself in troubles and out of your commandfort zone sometimes

Re: I nuked script.pm. Now postgres don't want to talk to me
by afoken (Canon) on Apr 12, 2017 at 15:08 UTC

    Permission denied sounds like you messed up the permissions of strict.pm (should be -rw-r--r-- = 0644) or of one of the directories leading there (should be drwxr-xr-x = 0755).

    How old is your last verifed backup? ;-)

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      Yes and could be worse. I found a file named strict.pm in /usr/lib/x86_64-linux-gnu/perl-base/ but not in the other directory. It seems that perl is looking in the wrong place. Maybe I had lost some links?

      Apt remove perl && apt install --reinstall perl didn't worked. Lets keep breaking things...

      Updated name of the module strict

Re: I nuked strict.pm. Now postgres don't want to talk to me
by shmem (Chancellor) on Apr 12, 2017 at 17:26 UTC
    (Title) I nuked script.pm. Now postgres don't want to talk to me
    (Body) Can't locate strict.pm in /usr/local/lib/x86_64-linux-gnu/perl/5.24.1/strict.pm

    Which one, script.pm or strict.pm ? I guess strict.pm, but you keep writing script.pm even in your replies. There's no such file in the perl core.

    Get your perl version running perl -v. Get the tarball of that perl version from http://cpan.org/src/5.0/. Unpack that tarball, locate strict.pm there. Run perl -le 'print for @INC' and copy the strict.pm from the unpacked tarball directory over to one of the locations shown by the last command, make it world readable. You should now be able to run into other errors. As soon as your perl is functional, re-install perl (and maybe perl-base, depending on what you are running) with your system's package manager.

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

      Is a typo. I wanted to say strict.pm. Keen eye for details :-) I didn't even notice it. Fixed.

Re: I nuked script.pm. Now postgres don't want to talk to me
by karlgoethebier (Monsignor) on Apr 12, 2017 at 18:08 UTC
    "...nuked...don't want to talk to me"

    I don't remember how often i've been bitten by something like this on SLES, Debian, Ubuntu & Mac OS X. Résumé/Conclusion: Combining VMWare with Perlbrew seems to be a solid solution to avoid such trouble.

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    Furthermore I consider that Donald Trump must be impeached as soon as possible

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2019-10-19 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?