in reply to %ENV is returning a blank

Your form is sending POST data and you're trying to decode GET data... they're not the same thing. I highly suggest you spend some time learning CGI and I also recommend using the fine CGI module to help you do it right.

Replies are listed 'Best First'.
Re^2: %ENV is returning a blank
by irvy (Initiate) on Aug 19, 2011 at 06:40 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.

      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