Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: broke my perl? :(

by Corion (Patriarch)
on Aug 25, 2010 at 09:16 UTC ( [id://857118]=note: print w/replies, xml ) Need Help??


in reply to broke my perl? :(

It seems that the perl interpreter cannot be found in the locations bash looks for it. You will need to check where perl is and then adjust your Perl scripts and possibly your bash environment to also look for it there.

This shell command tries to run perl in /usr/bin/perl. If /usr/bin/perl does not exist anymore, your system is likely severely broken.

/usr/bin/perl -wle 'print "Still here"'

If that outputs an error and you are on a Unix system, consult with somebody local to you on how to restore your machine to working order. That person should also give you either an introduction to Unix or revoke your rights to make changes to /usr.

If /usr/bin/perl exists and is runnable as is (see above), then it is likely that you just messed up your bash profile, by either setting up an alias for perl to point to something other than /usr/bin/perl. You can find that by typing:

alias

This will list all the aliases defined for your shell session. If you find that you defined an alias for Perl, change that alias, or even better, remove it.

If /usr/bin/perl exists but is a symbolic link to /gsc/bin/perl, you will need to check that /gsc/bin/perl exists and is runnable (see above).

As a general practice, I would adjust the $PATH variable to include another directory instead of copying my scripts into a directory that is already in $PATH.

Replies are listed 'Best First'.
Re^2: broke my perl? :(
by megnetz (Novice) on Aug 25, 2010 at 09:45 UTC
    Good tip on using another directory for my own scripts. Last time I was meddling with the /usr I broke my ubuntu OS and probably my hard drive.

    I tried executing the /usr/bin/perl -wle 'print "Still here"' which gave the same error as before. The file exists however and is not a mirror to /gsc/bin/perl (/gsc doesn't exist).

    <code> perl -wle 'print "Still here"' <\code>

    Yeilds:
    bash: /usr/bin/perl: /gsc/bin/perl: bad interpreter: No such file or directory

    Unfourtunately I'm the only one in my office using unix. Is there anything else I can do before reinstalling Ubuntu?
      Is there anything else I can do before reinstalling Ubuntu?

      You can try

      sudo aptitude reinstall perl

      I don't know if that will help, but it's certainly worth a try.

      Perl 6 - links to (nearly) everything that is Perl 6.
        Thanks! Worked like a charm! The /usr/bin/perl is still the old script i copied there but  perl -v again gives reasonable output. I guess this means apt-get is now separate from perl in newer ubuntu (i have lucid_lynx).

        Another question, now I have created a new directory for my own scripts. How can I direct these scripts to perl since perl is no longer in /usr/bin/perl and neither /gsc/bin/perl?

      The ubuntu forums have many posts on the topic of people messing up their system by messing around with the system perl. Mark it for reinstallation in Synaptic. Consider installing your own perl to avoid any system issues, see Re: LWP::UserAgent @ Ubuntu 8.04 64-Bit.

Re^2: broke my perl? :(
by megnetz (Novice) on Aug 25, 2010 at 10:48 UTC
    I tried installing latest perl release (5.12.1) from source but /usr/bin/perl is still the script I copied there. Maybe I have to remove it and then install perl again? Maybe perl sees the file still exists during installation and leaves it instead of overwriting it?

    apt-get is still healthy and running.

      "I tried installing latest perl release (5.12.1) from source but /usr/bin/perl is still the script I copied there."

      Don't do this, why aren't you reinstalling the version of Perl shipped with Ubuntu via the methods previously suggested?

        sry, missed that post.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://857118]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found