Solved

Getting a perl script to run without .pl extension

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
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

623 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