|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I'm working on a cgi script, in which I call a program. My predecessor had it setup as:
$result = `command 2> error_log`; Ok, all well enough. stdout goes to the variable $result, stderr to the file error_log. I've been making some major modifications to this script, though, and would like to set it up in such a way that I could send stderr to a variable as well. I really don't want to deal with creating a bunch of 0 length files, and I don't really need to keep the data around, so there isn't much point in me using a file. Also, it would be easier to say: if($errors) do_error_stuff then to say: if($errror_file_name size >0) do_error_stuff So, is there an easy way to send both stdout and stderr to variables? (I'd even settle for a not-so-easy-way, as it would make the rest of my job easier ![]() |
|
#2
|
|||
|
|||
|
I'm asuming that standard out put is what you mean by "stout" and same for "stderr". If that's the case, just do this:
$var = <STDOUT>; $error = <STDERR>; |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > stderr, stdout in a CGI script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|