Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> First Perl Programm, My first Perl programm
xsize
post 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?
Go to the top of the page
 
+Quote Post
s243a
post 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. smile.gif
Go to the top of the page
 
+Quote Post
eiteljoh
post 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>";
Go to the top of the page
 
+Quote Post
s243a
post 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/
Go to the top of the page
 
+Quote Post
cuber9
post 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..
Go to the top of the page
 
+Quote Post
eiteljoh
post 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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Perl Help(1)
  2. Second Perl Programm(0)
  3. Perl Programms(0)
  4. Perl Programming(0)
  5. Using Mysql With Perl(1)
  6. Perl V.s. Php(5)
  7. Easy Authenication With Cgi/perl(0)
  8. Perl Progamming/scripting(3)
  9. Perl/cgi Help!(3)
  10. Perl Interview Questions(1)
  11. Compiling Perl / Python?(3)
  12. Xmlhttprequest And Perl(2)
  13. Matching Accents In Perl Regular Expresions(1)
  14. Call C Code From Perl(1)
  15. Few Perl Snippets For Misc Things(2)
  1. What Is Perl ? For A Layman Like Me !(7)
  2. Where Do I Install Perl Scripts?(6)
  3. Perl As A Way To Program Desktop Applications(8)
  4. Perl Interactive Mode(2)


 



- Lo-Fi Version Time is now: 26th July 2008 - 02:45 PM