Home > Web Info > Script 4
Get 25 FREE MP3s!
Make A Perl Script
Section 3 - Putting A Perl Script Online

It's time to put the script online. Open your FTP or File Manager, log on to your server, and open the cgi-bin directory. I recommend using an FTP if possible. I use Leech FTP, and it is available for download in my Make A Free Web Page tutorial. Upload your script file, first.pl, to the cgi-bin. At this point you need set permisions for your script. If you use Leech FTP, right click first.pl online, and click set attributes. You will need to hilite the server side, and click the refresh button before the file will show up online. Set the permissions to 755. This gives the owner (listed first) permissions to the file to read (4) + write (2) + execute (1) = 7. The group (listed second) has permission to read (4) + execute (1) = 5. The public has permission to read (4) + execute (1) = 5. So the permissions are set to 755. If you don't set the permissions on a script, your script won't execute. This is usually the problem, when you can't make a script work. Improper syntax is another main cause of problems; omitting quatation marks and semicolons. If you are on a windows server, you don't need to set permissions.

Now, you should be able to execute the script. Open your browser, enter the path in your address bar, and push the enter key. The path will be something like http:your_dot.com/cgi-bin/first.pl. On my server the path would be: http://williambryan.com/cgi-bin/first.pl. You should see the words, "Check it out! My first webpage," on the screen. You can also call the script via a hyperlink on one of your web pages. <a href="http:williambryan.com/cgi-bin/first.pl"> </a> is how it would look on mine. If you have any problems making this work, contact me on my Help Page. Please don't give up. You can also use HTML to print your message in a Perl script. Something like this:

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<font size=4 color=000000 face=arial>Check it out!</font>";

I hope this helps you get started in Perl. The web is filled with scripts free for the taking. I would appreciate any comments, questions, suggestions you may have regarding this tutorial. Just contact me on the Help Page.




Page: Previous 1 2 3 4 5 Next


Search for:  


Copyright © 2000-2003 William Bryan Company - Main Page | Electronics |
Information | Games | Free Greeting Cards | Customer Care