At 2:14 PM -0500 1/6/03, Thomas R Wyant_III wrote:

>VMS is not Unix, but you _may_ be able to get your Unix syntax to work if
>you hold your tongue correctly.
>
>At some point in the history of VMS, a command called "pipe" was
>introduced, which appears to implement a lot of Unix I/O redirection
>functionality, including pipes and ">" redirection. So
>
>open OUTPUT, "pipe some_command 2>&1 |";
>
>may do what you want.

Yes, it may.  If "some_command" happens to be Perl, skip the
preceding "pipe" since Perl has its own redirection capabilities and
has had them since before DCL (the VMS shell) implemented them.

>Or it may not. One thing to beware of is that VMS doesn't really have
>pipes; instead it has something called (confusingly) mailboxes.

This is not something Patrick needs to know to get started, but it
may be worth mentioning the full story here.  Perl's pipes on VMS
(since 5.6.1 and later) are implemented with mailboxes.  My
understanding is that the C run-time also uses mailboxes internally
for its pipe implementation (popen, system, and such), but we had so
much trouble with hangs and deadlocks using the C RTL that we (well,
Chuck Lane, actually) developed a piping implementation especially
for Perl.  DCL's pipes, on the other hand, use a made-for-DCL pipe
driver that does many of the same things but apparently not all of
the things the C RTL would need.  The pipe driver is not documented
and probably not callable from user mode code, so it really wasn't an
option when Chuck cooked up his own pipe implementation.

> Most VMS commands (but not all,
>unfortunately!) have a /OUTPUT= qualifier to send the output to a file. If
>the command you want doesn't have this, you can issue the commands
>$ assign/user_mode output_file.dat sys$output
>$ assign/user_mode output_file.dat sys$error
>$ some_command
>All three of the above MUST BE ISSUED IN THE SAME PROCESS. So you'll have
>to write them all to a scratch file, and then execute that file as a
>command procedure.

In some cases one also needs to turn off messages.  See the help topic
SET MESSAGE.

Now, tell us how badly we've confused you and how far you've gotten
with our advice.
-- 
________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Reply via email to