From: Dave on
Gang,

I'm looking for an equivalent in perl to the php syntax:

$data = file_get_contents('php://input');

I've read some posts about IO::File::String and LWP::Simple possibly
being used instead of 'file_get_contents'. The php line accepts raw
input and assigns it to a variable. This input is coming from the
output of another script and not a file. If anyone has any ideas or
modules to look into, please feel free to chime in!

Thanks,
Dave
From: J�rgen Exner on
Dave <hendedav(a)gmail.com> wrote:
> I'm looking for an equivalent in perl to the php syntax:
>
>$data = file_get_contents('php://input');
>
>I've read some posts about IO::File::String and LWP::Simple possibly
>being used instead of 'file_get_contents'. The php line accepts raw
>input

I have no idea what raw input is supposed to mean.

> and assigns it to a variable. This input is coming from the
>output of another script and not a file.

Are your trying to capture the output of another program?

'perldoc -q output':
Why can't I get the output of a command with system()?

There are other ways for special circumstances, too, but in general you
want backticks or qx.

jue
From: Dave on
On Mar 26, 3:22 pm, Jürgen Exner <jurge...(a)hotmail.com> wrote:
> Dave <hende...(a)gmail.com> wrote:
> >     I'm looking for an equivalent in perl to the php syntax:
>
> >$data = file_get_contents('php://input');
>
> >I've read some posts about IO::File::String and LWP::Simple possibly
> >being used instead of 'file_get_contents'.  The php line accepts raw
> >input
>
> I have no idea what raw input is supposed to mean.
>
> > and assigns it to a variable.  This input is coming from the
> >output of another script and not a file.
>
> Are your trying to capture the output of another program?
>
> 'perldoc -q output':
>           Why can't I get the output of a command with system()?
>
> There are other ways for special circumstances, too, but in general you
> want backticks or qx.
>
> jue


Thanks for the reply, unfortunately backticks and qx are not quite
what I'm looking for. The description for php://input is as follows:

php://input allows you to read raw POST data. It is a less memory
intensive alternative to $HTTP_RAW_POST_DATA and does not need any
special php.ini directives. php://input is not available with
enctype="multipart/form-data".

Do perl have an equivalent for this?

Thanks,
Dave
From: RedGrittyBrick on
On 29/03/2010 13:49, Dave wrote:
> On Mar 26, 3:22 pm, Jürgen Exner<jurge...(a)hotmail.com> wrote:
>> Dave<hende...(a)gmail.com> wrote:
>>> I'm looking for an equivalent in perl to the php syntax:
>>
>>> $data = file_get_contents('php://input');
>>
>>> I've read some posts about IO::File::String and LWP::Simple possibly
>>> being used instead of 'file_get_contents'. The php line accepts raw
>>> input
>>
>> I have no idea what raw input is supposed to mean.
>>
>>> and assigns it to a variable. This input is coming from the
>>> output of another script and not a file.
>>
>> Are your trying to capture the output of another program?
>>
>> 'perldoc -q output':
>> Why can't I get the output of a command with system()?
>>
>> There are other ways for special circumstances, too, but in general you
>> want backticks or qx.
>
> Thanks for the reply, unfortunately backticks and qx are not quite
> what I'm looking for. The description for php://input is as follows:
>
> php://input allows you to read raw POST data. It is a less memory
> intensive alternative to $HTTP_RAW_POST_DATA and does not need any
> special php.ini directives. php://input is not available with
> enctype="multipart/form-data".
>
> Do perl have an equivalent for this?
>

Are you familiar with the CGI module?
Are you hitting out-of memory problems?

--
RGB
From: Dave on
On Mar 29, 9:26 am, RedGrittyBrick <RedGrittyBr...(a)spamweary.invalid>
wrote:
> On 29/03/2010 13:49, Dave wrote:
>
>
>
> > On Mar 26, 3:22 pm, Jürgen Exner<jurge...(a)hotmail.com>  wrote:
> >> Dave<hende...(a)gmail.com>  wrote:
> >>>      I'm looking for an equivalent in perl to the php syntax:
>
> >>> $data = file_get_contents('php://input');
>
> >>> I've read some posts about IO::File::String and LWP::Simple possibly
> >>> being used instead of 'file_get_contents'.  The php line accepts raw
> >>> input
>
> >> I have no idea what raw input is supposed to mean.
>
> >>> and assigns it to a variable.  This input is coming from the
> >>> output of another script and not a file.
>
> >> Are your trying to capture the output of another program?
>
> >> 'perldoc -q output':
> >>            Why can't I get the output of a command with system()?
>
> >> There are other ways for special circumstances, too, but in general you
> >> want backticks or qx.
>
> > Thanks for the reply, unfortunately backticks and qx are not quite
> > what I'm looking for.  The description for php://input is as follows:
>
> > php://input allows you to read raw POST data. It is a less memory
> > intensive alternative to $HTTP_RAW_POST_DATA and does not need any
> > special php.ini directives. php://input is not available with
> > enctype="multipart/form-data".
>
> > Do perl have an equivalent for this?
>
> Are you familiar with the CGI module?
> Are you hitting out-of memory problems?
>
> --
> RGB


I'm somewhat familiar with the CGI and I'm not getting any out-of
memory problems.