47 elsif($mode eq ‘send_email’)
49 my $your_name = param(‘your_name’);
50 my $your_email = param(‘friends_name’);
51 my $friends_name = param(‘friends_name’);
52 my $friends_email = param(‘friends_email’);
53 my $email_subject = $your_name . ‘ Recommends you visit ‘ . $site_to_promote;
54 my $email_body = <
tag as well.
Line 84: End our multiline print function with the CGI.pm function to output the end of an html document. The semicolon tells perl to stop printing, which we began on line 81.
Line 85: End the elsif statement with a closing bracket. We started this elsifstatement on line 47.
Line 86: Begin an else statement, to catch the case where someone specified a bad mode, perhaps a cracker trying to hack our script and cause the server harm.
Line 87: This begins a multiline print statement, passing as the first argument CGI.pm’s header function, which tells the web server that an html document is on its way out to the web browser.
Line 88: Pass another argument to print, the CGI.pm function for generating the html code to begin an html document.
Line 89: Pass one more argument to the print function, the CGI.pm function for generating an
html tag. Pass the h2 function a string to notify the user that a bad mode was specified.
Line 90: End our multiline print function with the CGI.pm function to output the end of an html document. The semicolon tells perl to stop printing, which we began on line 87.
Line 91: This closing bracket tells perl we are finishing our else statement we started on line 86.