in reply to porting a script from cgi_handlers.pl to CGI.pm (was : use CGI.pm)

Hey, it's a holiday - this is a semi-mechanical conversion to CGI.pm :

#!/usr/local/bin/perl -wT use strict; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); print header(), start_html( -title => "It's been sent"); print <<EOHTML; <H2 ALIGN=center>It's been sent!</H2> <HR ALIGN=center> <IMG SRC="http://www.iupui.edu/~webtrain/Graphics/Photos/bora_bora.jpg +"> <HR ALIGN=center> <H2 ALIGN=center>Thanks!</H2> <A HREF="http://www.iupui.edu/~webtrain/home.html">Back to Cindy's hom +e page </A> EOHTML my $name = param('name'); my $email = param('email'); my $status = param('status'); my $entry = param('entry'); my $cindy = param('cindy'); my $talk = param('talk'); my $surf = param('surf'); my $url = param('url'); my $whaturl = param('whaturl'); my $suggestion = param('suggestion'); my $explain = param('explain'); open (MAIL, qq%| mailx -s "Web mail!" cholling\@iupui.edu%) || die "Couldn't send mail - $!\n"; print MAIL <<EOMAIL; Sender: $name Email address: $email Status: $status, $explain Type of Message: $entry How Did You Find Me: $cindy $talk $surf $url If URL, what URL? $whaturl Message: $suggestion EOMAIL print end_html();
Hope that helps.

Update: Removed $email from the subject line passed to mailx as this is a security risk.

/J\

  • Comment on Re: porting a script from cgi_handlers.pl to CGI.pm (was : use CGI.pm)
  • Download Code