Prev: FAQ 6.15 How can I print out a word-frequency or line-frequency summary?
Next: FAQ 4.63 Why don't my tied hashes make the defined/exists distinction?
From: Dave on 26 Mar 2010 15:00 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 26 Mar 2010 15:22 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 29 Mar 2010 08:49 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 29 Mar 2010 09:26 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 29 Mar 2010 09:57
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. |