print_environment_using_perl_cgi
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Last revision | |||
— | print_environment_using_perl_cgi [2018/08/22 20:57] – created k2patel | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Print Environment variable ====== | ||
+ | # this is really helpful while working with proxy etc.. | ||
+ | |||
+ | <code perl> | ||
+ | # | ||
+ | |||
+ | use strict; | ||
+ | use Net::Domain qw(hostname hostfqdn hostdomain); | ||
+ | use CGI qw(: | ||
+ | use CGI::Carp qw(warningsToBrowser fatalsToBrowser); | ||
+ | |||
+ | print header; | ||
+ | print start_html(" | ||
+ | |||
+ | foreach my $key (sort(keys(%ENV))) { | ||
+ | print "$key = $ENV{$key}< | ||
+ | } | ||
+ | |||
+ | my $fqdn = hostfqdn(); | ||
+ | |||
+ | print " | ||
+ | |||
+ | print end_html; | ||
+ | </ |
print_environment_using_perl_cgi.txt · Last modified: 2020/08/10 02:35 by 127.0.0.1