ahref.com > Guides >
Technology
Building a Site Submission Program, Continued
Finishing Up
Line 101 adds some final formatting to the program output, and line 102 calls the subroutine which actually sends out the output. Line 103 finishes the program.
101 $output_string .= "</BLOCKQUOTE>";
102 &show_output ($output_string);
103 exit;
The output subroutine, on lines 105-118, is fairly standard. It opens the header file, prints its contents to the screen; prints the output string, which has been accumulating text throughout the program; and opens the footer file and prints out its contents.
105 sub show_output {
106 my $output_string = shift (@_);
107 open HEADER or die "Can't find file $HEADER: $!\n";
108 while (<HEADER>) {
109 print $_;
110 }
111 close HEADER;
112 print $output_string;
113 open FOOTER or die "Can't find file $FOOTER: $!\n";
114 while (<FOOTER>) {
115 print $_;
116 }
117 close FOOTER;
118 }
|