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

Reply via email to