in reply to Re: %ENV is returning a blank
in thread %ENV is returning a blank

Sorry, I posted the above in a hurry before I went to work, I therefore got the post and get methods mixed. I have tried both, post and get, and both give me empty data back.

Replies are listed 'Best First'.
Re^3: %ENV is returning a blank
by Anonymous Monk on Aug 19, 2011 at 06:46 UTC

    Sorry, I posted the above in a hurry before I went to work, I therefore got the post and get methods mixed. I have tried both, post and get, and both give me empty data back.

    Instead of your program, try something like this instead

    #!/usr/bin/perl -- use strict; use warnings; use CGI; use Data::Dumper; #zum debuggen Main( @ARGV ); exit( 0 ); sub Main { my $cgi = CGI->new; print $cgi->header(); # Write HTTP header print $cgi->start_html, $cgi->b(rand time, ' ', scalar gmtime), '<table border="1" width="%100"><tr><td>', $cgi->Dump, '</td><td><div style="white-space: pre-wrap; overflow: scroll;">', $cgi->escapeHTML( Dumper( $cgi ) ), '</div></td></tr></table>', CGI->new( \%ENV )->Dump, $cgi->end_html; }

    Reading the manual is fundamental
      Hello, thank you for your quick response. I did try your script. It is giving me output on all the ENV variables, however the QUERY_STRING is still blank. The 'params' is empty. Could it be possible that I need to set up something else on the server? Irwin

        Could it be possible that I need to set up something else on the server

        Can't say, never heard of a webserver that would execute cgis, but then fail to set the required ENV vars ... but all we've got is your word that something is wrong, and for all we know, you're looking at the wrong thing :/