LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-20-2001, 02:55 PM   #1
1huskerfan
LQ Newbie
 
Registered: Jun 2001
Posts: 1

Rep: Reputation: 0
Question Executing Perl Programs


I am new to Linux and am attempting to program in Perl. Just finished the infamous "Hello world!" program and don't know how to execute it. All permissions are right, just dont know the right command. I know this must be a very simple question. Can anyone help me?
 
Old 06-20-2001, 03:32 PM   #2
doodah
Member
 
Registered: Apr 2001
Location: Columbus,OH
Distribution: slackware
Posts: 122

Rep: Reputation: 15
$ perl XXXXXXXX

where XXXXXXXX is the prog name..
 
Old 06-20-2001, 04:58 PM   #3
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
You can create a file with #!/usr/bin/perl -w (assuming that your Perl is in /usr/bin/) as the first line then chmod the file to 700 then just execute it if you want.

I'd advise you to always use -w as it gives you useful warnings that can be really good for spotting typos that would otherwise not causes syntax errors but will cause logical errors that are a nightmare to find in bigger scripts.

If you're after good books check out the O'Reilly series - especially 'Programming Perl' (the "camel" book) and the 'Perl Cookbook'

HTH

Jamie...
 
Old 01-06-2002, 07:39 PM   #4
webbdesigns
LQ Newbie
 
Registered: Jan 2002
Posts: 5

Rep: Reputation: 0
Perl...I believe that I can give you a little more to go on.

You need to have the perl executable inorder to run a perl script. The #/usr/bin/perl thingy is the path of the perl executable. The is a 'perl distribution' that you can download, or you can get a binary version and install it, either way you need to have that hunk of code there to do the executing.

Next, look in your server directives and locate the script alias. In apache it is httpd.conf file. In apache a script alias will make the translation where /cgi-bin/ = /usr/local/www/ (or something like that). When the cgi script is executed, the proper path will be inserted, oblivioius to the user.

And once again, the shebang in the top of your perl script will be the path to the perl program that runs the script.

Good luck.
Jimbo
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing web based Perl programs in userdirs markham82 Linux - General 3 12-15-2004 07:49 PM
executing perl script through .forward file skverma_in Linux - General 0 10-18-2004 05:06 AM
executing programs?!? cmargiol Linux - General 8 10-29-2003 02:38 PM
Executing X-Programs remotely frankieboy Linux - General 3 10-08-2003 02:31 AM
executing programs with arguments ? shaneblyth Mandriva 10 09-27-2003 08:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration