Solved

Getting a perl script to run without .pl extension

Posted on 2003-12-04
5
383 Views
Last Modified: 2010-03-04
Hi
I am running perl on HP-UX and I can't get perl scripts to run without having the .pl extension.  On a SUN and LINUX box i could call the script anything I want and it ran as long as I had the shebang line at the top. On HP it will not work. Is there some enviromnent setting I need?

Thanks
0
Comment
Question by:neptuna
5 Comments
 
LVL 3

Accepted Solution

by:
merphle earned 150 total points
ID: 9877169
Does the shebang have the correct path to perl on your HPUX system, and the executable bits on the script are set?

If the above is correct, have you tried creating a simple shell script to call perl explicitly, naming your script?

E.g., rename perl script to "/path/to/myperlscript", create shell script as:

#!/bin/sh
exec /bin/perl /path/to/myperlscript $*
0
 
LVL 20

Assisted Solution

by:jmcg
jmcg earned 50 total points
ID: 9877210
I never had a problem with this on HP-UX. You're talking about command-line execution, right?
0
 
LVL 3

Assisted Solution

by:terageek
terageek earned 50 total points
ID: 9877281
Does your script work when you add the .pl extension?
What is the error message that you see when you try to run your script?
0
 

Author Comment

by:neptuna
ID: 9877849
Ok. I am real embarresed now.  This is a brand new box so I am still getting my bearings. The problem was that  the current directory "." was not in the PATH.  So when I ran the script like this
./test
it worked fine!!
I will split the points
0
 
LVL 20

Expert Comment

by:jmcg
ID: 9886886
You can get your points refunded if a question turns out to be a red herring like this. Next time something it happens, you should just post a request in Community Support and ask for a moderator to delete the question.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now