I've been sort of conscripted at work to help convert some automated processes from VMS's DCL to Perl in preparation for moving to an AIX system. Writing Perl, I thought, would be fun. Even if it's on VMS. ;-)

Well, I don't know much about VMS but one thing that I thought I knew was that VMS does support pipes. And it does. Sorta.

There is a VMS command PIPE that allows you pipe one command into another from the command line. It works like so: $> PIPE DIR | SEARCH SYS$INPUT TEST.PL (searches a directory listing for the file 'TEST.PL')

With Perl, I can even get a pipe from a process (open INFILE, " command |";) to work.

Unfortunately, I need a pipe going the other direction and I just can't seem to get it to work. From what I can tell, I should be able to accomplish this somehow but I'm sure I'll have to jump through a few proverbial hoops for VMS to do it.

What I'd like to know is whether it's just something I'm doing wrong, or if it doesn't work at all and I'm wasting my time, or if there's something special I have to do to get it to work.

My code, and the error I get, are below. I sure hope some of the great programmers can help me on this one! TIA!

The Code:

#!perl -w use strict; use vmsish; # The 'TYPE ...' is basically a 'cat > FILE.TMP'... open OUTFILE, ' | TYPE SYS$INPUT /OUTPUT=FILE.TMP' or die "$0: can't open: $!"; print OUTFILE "Wish this would work...\n"; close OUTFILE or die "$0: can't close: $!";

The Results: test.pl: can't open: file specification syntax error at test.pl line 6.

bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.


In reply to VMS: Pipe to process by bbfu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.