But how does the variable become associated to the HTML line? 'is the value of $Firstname',
Thanks
<code>
#!/usr/local/bin/perl -w
use strict;
use diagnostics;
use CGI qw(:standard);
my $Firstname = param('Firstname');
print header(),
start_html(-title=>"CGI.pm Example Script"),
h1('Hello World!'),
'is the value of $Firstname',
end_html();
exit (0);
| [reply] [d/l] |
Greetings cal,
In Perl, using a single quote simply reads a string literally, but a double quote interprets a string. In your code, you have single quotes around the string where you use $Firstname. So what gets printed is literally "$Firstname". You actually want Perl to interpret the variable, so...
print header(),
start_html(
-title => 'CGI.pm Example Script'),
h1('Hello World!'),
"is the value of $Firstname",
end_html();
-gryphon
code('Perl') || die;
| [reply] [d/l] |
my $PERL_FAQ = "butterscoth";
print 'my $PERL_FAQ \n';
print "my $PERL_FAQ \n";
____________________________________________________ ** The Third rule of perl club is a statement of fact: pod is sexy. | [reply] [d/l] |