On Thu, 19 Sep 2002 09:45:53 -0500
Scott Nelson <[EMAIL PROTECTED]> wrote:
> I am having problems reading standard input while running under PerlRun.
> I am trying to use text/xml data POSTed to an url, as opposed to form-data.
>
> I get the data when running in CGI mode, but I get zero bytes when
> running in PerlRun mode. How do I read the data POSTed to the URL?
>
> I have isolated my problem down to this short script:
>
> #! /usr/bin/perl -w
>
> use strict;
> use diagnostics;
> use XML::LibXML;
>
> my $parser = XML::LibXML->new();
> my @input = <>;
> my $input = join("\n", @input);
> #my $doc = $parser->parse_string($input);
> #my $plainText = $doc->toString();
> my $plainText = $input;
> my $length = length($plainText);
>
> print "Content-type: text/plain\n";
> print "Content-length: $length\n";
> print "\n";
> print $plainText;
>
> The content length is 0!
I guess you've checked that $plainText isn't of length 0?
/Jon