I\'m using Perl/CGI/Apache and want to fetch the X-Forwarded-For HTTP header. How do I do that?
CGI has a method for accessing HTTP request header fields, called "http", so you can say:
my $q = CGI->new() print $q->http('X-Forwarded-For');
This works regardless whether you're running as a CGI, in fastcgi, mod_perl, etc...