|
|
|
|
![]() ![]() |
Oct 19 2004, 06:40 PM
Post
#1
|
|
|
Newbie [Level 2] ![]() ![]() Group: Members Posts: 29 Joined: 19-October 04 From: Russia Member No.: 1,827 |
I wonna show you my first perl programm:
CODE #!/usr/bin/perl # See Log file print "Content-type: text/html\n\n"; print "<HTML><HEAD><TITLE>Mind of Perl</TITLE>"; print "<head><body><p>"; print "<h1>Hay Cgi-BIn</h1>"; print "</body></html>" if you have other perl script, post it in this topic. How write perl counter? |
|
|
|
Dec 12 2004, 10:13 PM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 408 Joined: 7-December 04 From: Nova Scoita, Canada Member No.: 2,604 |
How does it work? I started reading a book on pearl about 6 years ago but I didn’t finish it and forgot everything I learned. I assume the # denotes comment, ; for end of line. I recognize you are printing an HTML file. My questions are: how does the program know where to print? When and how does the program get executed, and does it show up automatically in your web browser or do you have to open the file first? I’ll probably get around to reading some stuff on my own soon enough but a discussion can be more fun then a book.
|
|
|
|
Dec 14 2004, 01:25 AM
Post
#3
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 101 Joined: 3-December 04 Member No.: 2,521 |
That's cool - i'm just learning too. Now you can add CGI module, and makes life easier!! so you can replace things like "<br>" with br
not sure what the other benefits of it are ... CODE #!c:\perl\bin\perl -w use CGI qw/:standard/; use CGI; print header; print "<html>"; # unsure of the cgi rep for this. print br . "Hello" . p . hr . "World"; print </html>"; |
|
|
|
Dec 14 2004, 08:21 PM
Post
#4
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 408 Joined: 7-December 04 From: Nova Scoita, Canada Member No.: 2,604 |
Speaking of Perl Programing. This guy has a few examples.
http://www.scriptarchive.com/ I noticed the get call puts functionname.cgi?(input arguments) in the URL. But would the Perl scripts have a .pl after the file name. Is functionname.cgi, some other file that interprets the perl script? How do you create it? Maybe this will give me the answers I want. http://www.cgi101.com/book/ |
|
|
|
Dec 21 2004, 04:05 PM
Post
#5
|
|
|
Newbie ![]() Group: Members Posts: 4 Joined: 21-December 04 Member No.: 2,828 |
do you want your website translate to hebrew language>? that's in israel..
|
|
|
|
Apr 5 2005, 06:02 AM
Post
#6
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 101 Joined: 3-December 04 Member No.: 2,521 |
i'll make a tip for you, since i just went through some learning as well.
#!c:\perl\bin\perl -w use CGI qw/:standard/; this will also help with the trap17 website when you get going. 1) you'll need to change the 1st line of your perl to: #!/usr/bin/perl -w 2) make sure you keep using the CGI init the way you are... i spent about 3 hours trying to fix what was happening, and got really confused about it ... but i had use CGI qw(:standard) ; #-- BAD!!! i have no idea why, but it works fine on my computer. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 26th July 2008 - 02:45 PM |