Solved

Getting a perl script to run without .pl extension

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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 a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

809 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