Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Can't open perl script

by Anonymous Monk
on May 14, 2007 at 12:39 UTC ( #615288=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks, one of our servers OS was upgraded. After the upgrade some of my perl scripts throw out this error: Can't open perl script. But the scripts run fine if i run the script by adding the word perl in front of each script. perl version is v5.8. Thanks a lot in advance !!

Replies are listed 'Best First'.
Re: Can't open perl script
by cdarke (Prior) on May 14, 2007 at 13:27 UTC
    You say "some of my perl scripts" throw out the error. At what point do they throw the error, are they calling other scripts? What is different between those that work and those that do not?
    Is "Can't open perl script" the error message, the whole error message, and nothing but the error message? Are you sure that is not comming from (say) a system command or qx?
Re: Can't open perl script
by sgt (Deacon) on May 14, 2007 at 14:28 UTC

    Can it be that the upgrade touched some policy file indicating which interpreter can be run from the she-bang line? thinking /etc/shells and possible relatives here.

    cheers --stephan
Re: Can't open perl script
by jeanluca (Deacon) on May 14, 2007 at 15:21 UTC
    I would say it has to do with permissions.
    Can you check if you have read and execute permission for those perl scripts ?

      permissions were right. I finally could make some scripts work by adding -U flag and some scripts were include a file for some reason #!/usr/bin/perl -I/<pathtomodule> works while #!/usr/bin/perl -I <pathto module> does not Thanks to all monks for their prompt and quick responses !!
Re: Can't open perl script
by derby (Abbot) on May 14, 2007 at 12:53 UTC

    What OS? Sounds like the upgrade placed perl in a different location.

      AIX 5.2 I checked the path , permissions etc. which perl shows perl in /usr/bin/perl which the script points to. I had to modify PERL5LIB variable some other scripts work. But few scripts seem to work only by adding perl in the front. Since there are lot of scripts . The same script works perfectly on another box with the same environment.

        Hmmm ... what's your shebang line look like? Is it pointing to /usr/bin/perl? Make sure it doesn't have any odd characters at the end. (Who was promoting perl^M be in /usr/bin - that was silly but maybe your old system had it?)

Re: Can't open perl script
by Moron (Curate) on May 14, 2007 at 13:37 UTC
    "was upgraded" doesn't sound like sufficient information to formulate a solution. And it seems inconceivable that changing the O/S version should alone have such an impact. Something else has happened to coincide with the upgrade or possibly as part of some arcane plan associated with the upgrade and you need to find out what - otherwise we are just guessing!

    ^M Free your mind!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://615288]
Approved by varian
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2018-01-22 12:54 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (233 votes). Check out past polls.