programming-examples/perl/CGI/Display CGI environment variables.pl

29 lines
462 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!perl
use CGI qw( :standard );
print header;
print <<End_Begin;
<HTML>
<HEAD>
<TITLE>Environment Variables...</TITLE>
</HEAD>
<BODY>
<TABLE>
End_Begin
foreach $variable ( sort( keys( %ENV ) ) )
{
print <<End_Row;
<TR>
<TD><STRONG>$variable</STRONG></TD>
<TD>$ENV{$variable}</TD>
</TR>
End_Row
}
print <<End_Finish;
</TABLE>
</BODY>
</HTML>
End_Finish
# Must include newline after End_Finish!