Thanks Gary
That worked.
-----Original Message-----
From: Gary Stainburn [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 9:14 AM
To: Conrad, Bill (ThomasTech); [EMAIL PROTECTED]
Subject: Re: Compile Errors Question
Hi Bill,
the reason you're still getting errors on the screen is because you are
redirecting STDOUT and not STDERR. To redirect STDERR use:
perl perl-prog.pl 2>perl.log
To redirect both to the file you'd use:
perl perl-prog.pl >perl.log 2>&1
In other words, redirect STDOUT (filehandle 1), and then redirect STDERR
(filehandle 2) to the already redirected STDOUT.
Gary.
(I've only ever tested this on unix boxen, so it may not work if you're on
windows)
On Wednesday 20 June 2001 2:03 pm, Conrad, Bill (ThomasTech) wrote:
> Hi Gary
>
> I have tried redirecting the output to a file
>
> perl perl-prog.pl >perl.log
>
> but the compile error messages go to the console.
>
> Thanks
>
> Bill Conrad
>
> -----Original Message-----
> From: Gary Stainburn [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 20, 2001 8:36 AM
> To: Conrad, Bill (ThomasTech); [EMAIL PROTECTED]
> Subject: Re: Compile Errors Question
>
>
> Hi Bill,
>
> perl does send warnings and errors to STDERR.
>
> The redirection you speak of is actually done by the shell (the program
> providing the command prompt) and not the application itself.
>
> Therefore if you can redirect other commands, you can redirect perl.
>
> Gary
>
> On Wednesday 20 June 2001 1:25 pm, Conrad, Bill (ThomasTech) wrote:
> > Hi All
> >
> > Does PERL write compile errors and warnings to STDERR and if so is
> > there any easy way to have them written to a file rather then to the
> > console?
> >
> > Some language have a command line switch which allows you to
> > redirect the error messages to a log file, but I did not see one for
> > perl.
> >
> > Thanks
> >
> > Bill Conrad
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000