Hello Kyle,
> What does print <<"END_HTML"; do as apposed to <<EndOfHTML;
It does the same thing. When using a HERE document, I prefer to explicitly put in the
single or
double quotes. With single quotes, nothing is interpolated:
my $date = '20020416';
print <<"END"
$date
END
print <<'END'
$date
END
The first example prints 20020416 and the second example prints the literal string
$date.
<<EndOfHTML is the same as <<"EndOfHTML". It's a matter of taste. However, if you
explicitly use
the quotes, you can do this:
sub foo {
my $bar = shift;
if ( $bar ) {
print <<" END_HTML";
this is indented so our scoping indentation doesn't get messed
up by a HERE document
END_HTML
}
}
Otherwise, you're stuck with this:
sub foo {
my $bar = shift;
if ( $bar ) {
print <<END_HTML;
this is indented so our scoping indentation doesn't get messed
up by a HERE document
END_HTML
}
}
To me, that's just ugly :)
> What does the qw/:standard/; do?
That imports the standard CGI functions into your namespace. If you don't do that,
you have to
instantiate a new CGI object. Compare:
use CGI;
my $query = CGI->new;
my $data = $query->param('data');
print $query->header;
...
#####################
use CGI qw/:standard/;
my $data = param('data');
print header;
...
Do those examples make it clear? (if you're not familiar with OO programming, they
can look odd).
Using /:standard/ is nice because it saves on typing :)
> What is the content variable doing?
I just put that in so that I could assign data to it and print it in the middle of the
HTML
document. Otherwise, you'd have to repeat the HTML for each 'if' conditional.
> Other than that I think I get it.
Great :)
Cheers,
Curtis "Ovid" Poe
=====
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]