The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl question regarding [ ] hankooknara Shell Programming and Scripting 2 07-01-2007 04:21 PM
perl question BG_JrAdmin Shell Programming and Scripting 1 09-09-2005 07:46 PM
Perl Question Gary Dunn Shell Programming and Scripting 2 12-03-2004 12:37 PM
PERL question frank Shell Programming and Scripting 1 06-18-2002 03:13 AM
Perl question Jubba Shell Programming and Scripting 1 04-01-2002 02:24 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-28-2006
serm serm is offline
Registered User
  
 

Join Date: May 2005
Posts: 16
Perl Question

Hi everyone

I am not even a novice at Perl scripting .. but had to edit one the other day. The only way I can get it to run is by prefixing 'perl' before running it - ie # perl scriptname

I am running AIX.

Any ideas why i have to do that ?

Thanks!
  #2 (permalink)  
Old 09-28-2006
thestevew thestevew is offline
Registered User
  
 

Join Date: Mar 2006
Location: South Yorkshire, UK
Posts: 114
Perl is a scripting language run by the interpreter program - conveniently called 'perl'. So what you were doing was using your shell to run the perl interpreter and tell it which script to run. Alternatively, you can tell the shell which interpreter to use by putting the interpreter name inside the script. Do this by
having a line similar to
Code:
#!/usr/bin/perl
as the first line of your script - replace /usr/bin/perl with the path to your perl interpreter if your system is different.

hope this helps
  #3 (permalink)  
Old 09-28-2006
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
... and don't forget to chmod the script with executable permission.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0