Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to CGI/Perl Please use speaker notes for additional information!

Similar presentations


Presentation on theme: "Introduction to CGI/Perl Please use speaker notes for additional information!"— Presentation transcript:

1 Introduction to CGI/Perl Please use speaker notes for additional information!

2 First.cgi #!/usr/bin/perl #first.cgi print "Content-type: text/html\n\n"; #generate HTML print " \n"; print " First Script \n"; print " Hello World! \n"; print " \n"; This is the shebank line. It contains the sharp symbol (#) followed by the bang symbol (!) and then the location of the Perl interpreter on the system that you are using. Perl comments begin with the sharp symbol (#). The print function specifies that the type is text/html because this code sends an HTML document. The rest of the prints are sending the HTML which will be run.

3 The -c switch tells the perl interpreter to check the syntax of the script. First.cgi

4 You can see the HTML script that was generated as a result of using the -w switch with perl. First.cgi

5 Note that first.cgi is in the director C:\perl\bin which also contains the perl executable. First.cgi

6 Now I have uploaded first.cgi to my host and stored it in the directory named cgi-bin.

7

8 First.cgi This is the first.cgi script that I uploaded in the previous slide.

9 First.cgi

10 Note that it says: http://www.pgrocer.net/cgi-bin/first.cgi

11 First.cgi Note that the source is the same code that was put into the script. #!/usr/bin/perl #first.cgi print "Content-type: text/html\n\n"; #generate HTML print " \n"; print " First Script \n"; print " Hello World! \n"; print " \n";

12 First.cgi


Download ppt "Introduction to CGI/Perl Please use speaker notes for additional information!"

Similar presentations


Ads by Google