Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old November 23rd, 2000, 07:58 PM
Uchechi Uchechi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Location: Montreal, Canada
Posts: 62 Uchechi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 25 sec
Reputation Power: 8
Hello People,

I have been using perl for a while but my limit is only to customizing already written perl script. I saw the tutorial on perl on the front page of devshed.com and I decided to start writting my own perl scripts. The only problem is that I don't know how to run the scripts. Do I save the file with a .pl extension or .cgi? Do I have chmod any files or directory. In short, how do I execute the scripts. Thanks for the help in advance.

------------------
Visit my PHP V-Portal.
http://www.igboryders.com

Reply With Quote
  #2  
Old November 24th, 2000, 05:23 AM
udd udd is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 4 udd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to udd
I guess that you are running a linux/unix machine...

The most common extention is .pl I think, so you can name your scripts that, i e fun_script.pl.

Then you probably should run chmod 755 fun_script.pl (to make the script accessible).

From that point you can access the script from the Net, or run it on your local machine by writing perl fun_script.pl.

Reply With Quote
  #3  
Old November 24th, 2000, 10:01 AM
Uchechi Uchechi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Location: Montreal, Canada
Posts: 62 Uchechi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 25 sec
Reputation Power: 8
Thanks, one more question. Do I have to chmod the directory. And yes, I am working on a unix box.

------------------
Visit my PHP V-Portal.
http://www.igboryders.com

Reply With Quote
  #4  
Old November 24th, 2000, 10:27 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>Do I have to chmod the directory

By default, no. It depends on whether you are testing your scripts from your own box or hosting it somewhere.

If Apache is run as nobody, then that directory needs to be 755 (drwxr-xr-x).

Reply With Quote
  #5  
Old November 25th, 2000, 02:58 PM
Wefrucar Wefrucar is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 2 Wefrucar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Well, I would save it as a .cgi file. This is if you want to put these scripts on the web. If you're just making scripts for your own personal use, .pl is fine....

If you will be publicly using these scripts, save them as your_file.cgi
Then, once you've saved it, you need to go to your Unix and enter chmod 755 your_file.cgi

The first digit (7), is what permission the owner of the file has, the second digit (5) dictates what permission the group that the owner belongs to has, and the third (5) dicatates what permissions everyone else has. Read permission is 4, write permission is 2, and execute permission is 1. So, 7 means you can read, write, and execute the file (4+2+1), and 5 means you can read and execute it (4+1)

Reply With Quote
  #6  
Old November 27th, 2000, 12:51 PM
marsha25 marsha25 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 0 marsha25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
one difference on my server is file.pl will only run in the cgi-bin but file.cgi will run in any directory... i dont know if this is unique just on my server..

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Newbie Question


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway