esharris has asked for the wisdom of the Perl Monks concerning the following question:
In the following code, what is wrong with the 2nd application of CGI::header?
#!/usr/bin/perl -w use strict; use CGI qw/:standard/; my @a; my $i = 0; eval { print "\nTake ", $i++, ",\n", header, "\n"; print "\nTake ", $i++, ",\n", header @a, "\n"; print "\nTake ", $i++, ",\n", header (@a), "\n"; print "\nTake ", $i++, ",\n", header (), "\n"; }; if ($@) { print "I died: $@\n"; }
I thought each header call would produce the same output. However, the 2nd call produces an empty Content-Type string.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: passing parameters to CGI::header
by Aristotle (Chancellor) on Aug 13, 2004 at 12:41 UTC |