At 9:57 PM -0500 11/16/02, Michael G Schwern wrote:
>MakeMaker has a macro called DEV_NULL which is tacked onto the end of shell
>commands to supress their output.
>
>On Unix its defined as '> /dev/null 2>&1'
>On Windows its simply '> NUL'
>
>MM_VMS doesn't have a definition for DEV_NULL. Is there an equivalent?
>Hopefully one that goes on the end of a command and not the front.
There is an equivalent for /dev/null, but the Unix idiom you cite
involves not just the existence of a null device but the redirection
of stdout to it and the simultaneous redirection of stderr to the
already-redirected stdout. That can't all be done in one command on
all versions of VMS. The equivalent idiom on VMS would be:
$ define/user_mode sys$output _nla0:
$ define/user_mode sys$error _nla0:
$ some_error_generating_command
where the /user_mode qualifier on the define command specifies that
the redirection is only in effect for the next image activation
(duration of a running program), and _NLA0: is the null device (with
preceding underscore and controller letter and number optional).
This isn't the whole story if we are in the middle of a DCL procedure
where an exception handler has been specified. It is also possible
to suppress error messages with the "set message" command.
Now, if we are purely in the context of Perl one-liners, the same
idiom you are using will work because Perl emulates the Unix behavior:
$ perl -e "system('notacommand');" > NL: 2>&1
The unrecognized command error message is suppressed.
HTH.
--
________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]
"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser