httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <torsten.foert...@gmx.net>
Subject Re: [users@httpd] passing all env vars to a cgi
Date Thu, 12 Feb 2009 08:51:22 GMT
On Thu 12 Feb 2009, J├╝rgen Mathwich wrote:
> When doing a
>
> # cat /proc/<APACHE-PID>/environ
>
> it shows me more variables than the cgi knows about. Now I have a
> project where I need to pass all the vars without knowing their keys
> to the cgi (just ALL of them), but I don't have any idea how to solve
> this in a easy way.

Why not just read that file?

If you are using perl perhaps the following one-liner helps. In your 
script it would look like "%ENV=do{...};"

perl -Mstrict -MData::Dumper -e 'my %h=do{local $_; local $/="\0"; local 
@ARGV=("/proc/".getppid."/environ"); map {split /=/, $_, 2} <>}; print 
Dumper \%h'

Torsten

-- 
Need professional mod_perl support?
Just hire me: torsten.foertsch@gmx.net

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message