in reply to Re: redirecting STDERR from shell commands
in thread redirecting STDERR from shell commands
Please forgive me, but I only had access to a Windows 2000 PC. *Smiles*
use strict; system("del doesnotexist1"); close(STDERR); open(STDERR,">stderr.out") || die "Could not open STDERR...\n"; system("del doesnotexist2");
This results in "Could Not Find C:\TEMP\doesnotexist1" being displayed on the screen (default for STDERR) and "Could Not Find C:\TEMP\doesnotexist2" being written to stderr.out.
Looks like system() inherits STDERR from the Perl script.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Some things I would have never guessed...
by seesik (Initiate) on Sep 07, 2001 at 17:33 UTC |