Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Getting a perl script to run without .pl extension

Posted on 2003-12-04
5
Medium Priority
?
429 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 3

Accepted Solution

by:
merphle earned 600 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 200 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 200 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

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…
Six Sigma Control Plans

715 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