in reply to Re: CGI script to create a HTML document
in thread CGI script to create a HTML document

I really appreciate everybody's warmly help. I am a new comer to perl. I don't fully understand the previous post's answer, so I really want to get help. Here still have some compilation errors.(near $q->end_html) Please assist me again. Thank you very much!
#!C:/Perl/bin/perl use strict; use CGI::Pretty qw( -debug ); use CGI::Carp qw( fatalsToBrowser ); my $q = new CGI; my $pay = $q->param('payment'); my $pay_text; if ( $pay eq "discover" ) { $pay_text = "Discover Card"; } elsif ( $pay eq "master" ) { $pay_text = "Master Card"; } elsif ( $pay eq "check" ) { $pay_text = "by check"; } else { $pay_text = "unknown method"; } print $q->header, $q->start_html( -title=>"Welcome", -bgcolor=>"pink"), $q->p( "Your name is ", $q->b("name")), $q->p({-style=>"text-decoration:underline"},"Your age is ",$q->t +extfield(-name=>"age")), $q->p( "Your method of payment is ", $q->span({-style=>"color:blue"},$pay_text), $q->end_html;

Replies are listed 'Best First'.
Re^3: CGI script to create a HTML document
by Melly (Chaplain) on Nov 29, 2006 at 17:40 UTC

    Close, but you are missing a closing bracket - change:

    $q->p( "Your method of payment is ", $q->span({-style=>"color:blue"},$pay_text),

    to (indented for clarity)

    $q->p("Your method of payment is ", $q->span({-style=>"color:blue"},$pay_text) ),
    map{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e** 2-$d**2+$b);$c=$d**2+$e**2>4?_:0}1..99;print$c}0..59;print$/}0..20;
    Tom Melly, pm@tomandlu.co.uk