Solved

Getting a perl script to run without .pl extension

Posted on 2003-12-04
5
374 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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 …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

16 Experts available now in Live!

Get 1:1 Help Now