- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Perl Script execution troubles
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2000 05:36 AM
тАО09-06-2000 05:36 AM
A few weeks ago I installed Perl V5.6.0 on my HP-UX 11.0 system. I've downloaded some perl scripts from O'Reilly's web site that go with the book Learning Perl by Tom Christiansen and Randall Schwartz.
The only modification I've made to any of the scripts is on the first line. My perl is located at /opt/perl5/bin
I do not have the location of my scripts in /etc/PATH
I go to the location of the script and type:
./ch01_hello to try and execute it.
When ever I try to execute the script I get execute permission denied.
I have chmod 777 on the file. I have also set chown to root sys.
I'm executing the script logged in as root.
Other scripts that I have typed in work fine. Why would I be getting this message...what am I missing?
Thanks for your time.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2000 05:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2000 05:42 AM
тАО09-06-2000 05:42 AM
Re: Perl Script execution troubles
#!/opt/perl5/bin/perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2000 05:43 AM
тАО09-06-2000 05:43 AM
Re: Perl Script execution troubles
If a user, are there any system calls thast require root to execute?
Do set the PATH for the perl stuff. Don't need to do it in /etc/PATH, can do it in the .profile and/or the /etc/profile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2000 05:44 AM
тАО09-06-2000 05:44 AM
Re: Perl Script execution troubles
I meant /opt/perl5/bin/perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2000 05:44 AM
тАО09-06-2000 05:44 AM
Re: Perl Script execution troubles
I meant /opt/perl5/bin/perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2000 05:44 AM
тАО09-06-2000 05:44 AM
Re: Perl Script execution troubles
Check the following:
1. on the first line of your ch01_hello script, set the line:
#!/opt/perl5/bin/perl
2. Make sure that you have /opt/perl5/bin set up in your /etc/PATH (BEFORE) /usr/contrib/bin (otherwise the default perl will take over)
3. finally ensure that your that your perl script actually runs with:
/opt/perl5/bin/perl ./ch01_hello
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2000 05:53 AM
тАО09-06-2000 05:53 AM
Re: Perl Script execution troubles
talk about some fast answers!
I changed the first line in my script to /opt/perl5/bin/perl and that solved the problem...I did not want to put perl5 in my PATH yet because I was concerned I might "break" something else on my system...
I take it that when the script executes it reads the first line and uses the perl5 code..is that correct?
Thanks again folks for helping the newbie out!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2000 06:12 AM
тАО09-06-2000 06:12 AM
Re: Perl Script execution troubles
Actually it is highly unlikely that anything will break with perl5 as opposed to the default perl 4 since perl 5 is a superset (and backwardly compatible with perl 4).
Yes, the #! construct is a common scripting construct in unix to tell the command interpreter where to find the the program that executes the rest of the script... you would do the same if you were programming an awk script etc.
Good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2000 06:57 AM
тАО09-06-2000 06:57 AM