At 6:03 PM -0800 1/6/03, Li, Patrick wrote:
>Still no luck. I tried doing the "open OUTPUT, "pipe some_command 2>&1 |";
>method but i am getting funny outputs back.. in my case, some_command is
>actually a cvs command... specifically open OUTPUT, "cvs diff --brief -l -r
>prdsr021212 2>&1 |", etc...
<snip>
>when running the same script on VMS however, i get this:
>$ perl promote3
>
>Please enter the Change Request # you are promoting files for: 12345
> Gathering file information in current directory. Please wait...
> Hit Ctrl-C to abort.
>pipe cvs diff --brief -l -r prdsr021212 2>&1 |
>first diff: ?
>first diff:
>first diff: ?
>first diff:
>first diff: ? 1
>first diff:
>first diff: ? .1
<snip>
I don't know if it's significant that you entered 1234 in the Unix
example and 12345 in the VMS example.
I'd say the first thing is to make sure the cvs command does what you
expect without pipe or Perl. Then add pipe to the picture, perhaps
redirecting output to a file and seeing if the file is what you
expect. Then see if pipe and Perl do what you want without cvs:
$ type bar.txt
foo
bar
baz
$ perl -e "open F, qq{pipe type bar.txt 2>&1 |}; while (<F>) { print };"
foo
bar
baz
$
One possibility is that cvs is talking in a stream-oriented manner to
a record-oriented device (the mailbox/pipe that Perl is reading), but
that's just a guess. If you can get it down to a 5-line reproducer,
then we might be able to nail it down better. Something along the
lines of what Maarten suggested might also be helpful. There's a
possibility that there is something quirky about the cvs client, not
Perl. BTW, what are your Perl and VMS versions:
$ perl -v
$ write sys$output f$getsyi("node_swvers")
--
________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]
"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser