Dying here people! I am have basically confirmed that I my script is getting a POST and that it has some length to it, etc.:

$ENV{REQUEST_METHOD}
$ENV{'CONTENT_LENGTH'}

But this line here:

read (STDIN, $query, $ENV{'CONTENT_LENGTH'});

Comes back with $query being blank. Surely I am missing something? Wish I knew Perl better.

Thanks ahead, as always.

Recommended Answers

All 3 Replies

should work, but really you should use the CGI module to get post and get (and other) data into your perl based CGI scripts. Trying to do it like you are is not secure, could lead to problems.

Well I don't know the data coming in (this is for use with Paypal's IPN).

And the worst part is this SHOULD work! Yes, every page I have Googled says this is the way, and NOTHING!

If you meant using some other method in CGI thta I am missing, please let me know.

Thanks

I mean use the CGI module. To get you started:

use CGI;
my $query = CGI->new;
my %data = $query->Vars;#gets 'post' or 'get' data in name/value pairs
print $query->header();
foreach my $param (keys %data) {
   print "$param = $data{$param}\n";
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.