Kev is correct, but the bug he refers to is only on WinNT 4.x

On approximately 2/23/2004 9:58 AM, came the following characters from
the keyboard of Kevin Hill:
Guys,

My understanding is that there is a bug in the file extension/application to execute code, that is part of windows, that stops redirection from working if Microsoft does this "lookup" itself. Stopping it having to do this lookup, by invoking Perl.exe directly, gets around this issue. This problem has been around for as long as I can remember.

Kev.



-----Original Message-----
From: Martin Leese [mailto:[EMAIL PROTECTED]
Sent: 23 February 2004 05:05 pm
To: [EMAIL PROTECTED]
Subject: Re: Pipe and redirect STDOUT


Sui Ming Louie wrote:


I have run similar batch files on NT4.0.  They worked OK.  At one point, I
used to think that redirection from batch files was not possible.  Then I
got some insight from reading the perl2bat.bat file included with Perl.


I asked the original question, so I thought I would try to
summarize progress to date.

First, many thanks to everyone who has responded.  One
poster suggested the problem might be that typing "test.pl"
invoked a BAT file, and that my problem was redirection
from BAT files in general.

There is no "perl.bat" on my system, so this is not the
problem.  Also, redirection from BAT files appears to work
as expected.  (Also, also, there is no "perl2bat.bat" file
on my system.)

Another poster suggested trying "perl test.pl" and, indeed,
redirection using this form of invocation works fine.  This
is a valid work around and, although my problem has not
been solved, my problem is no longer a problem.


Martin Leese wrote:

Hi,

I know this is a really dumb question (yes, there are dumb
questions), but I am stuck.

Why can I neither pipe the output from a perl script to "more"
nor redirect it to a file?  This is under Windows NT.

The following script:

#! /usr/local/bin/perl
#
use strict;
use warnings;
###use diagnostics;
#
print STDOUT "Hello me";
#
exit(0);

produces "Hello me" on the screen with the command "test.pl".
However, the command "test.pl |more" produces a blank line,
and the command "test.pl >test.txt" produces an empty file.
Why?

As the more intelligent amongst you will have guessed, I am
not a Windows person.

Also, while you are here, what is the difference between
"use warnings;" and "use diagnostics;"?

I am running perl, v5.8.2 built for MSWin32-x86-multi-thread,
Binary build 808 provided by ActiveState Corp. under
Windows NT.

Many thanks for any help you can give.

Regards,
Martin


Thanks again to everyone who responded,
Martin


_______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

________________________________________________________________________

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. TradeWeb reserves the right to monitor all e-mail communications through its networks.


_______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



-- Glenn -- http://nevcal.com/ =========================== The best part about procrastination is that you are never bored, because you have all kinds of things that you should be doing.

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to