September 2002
Intermediate to advanced
544 pages
13h 6m
English
Now that you’ve seen how topics are displayed, let’s take a look at how new topics are created and how responses are added to existing topics. The post.pl script serves two purposes. First, it is used to create new topics, and second, it’s used to append responses to existing topics. The source code for the script appears in Listing 14.3.
1: #!/usr/local/bin/perl -Tw 2: 3: use CGI; 4: use strict; 5: use CGI::Carp qw(fatalsToBrowser); 6: 7: my $query = new CGI; 8: my $topic_directory = "topics"; 9: my $page_title; 10: my ($action, $author, $title, $post, $response_to) = ("","","","",""); 11: 12: print $query->header; 13: 14: if ($query->param('action')) { 15: &set_variables; 16: 17: ... |
Read now
Unlock full access