1vmsish(3pm)            Perl Programmers Reference Guide            vmsish(3pm)
2
3
4

NAME

6       vmsish - Perl pragma to control VMS-specific language features
7

SYNOPSIS

9           use vmsish;
10
11           use vmsish 'status';        # or '$?'
12           use vmsish 'exit';
13           use vmsish 'time';
14
15           use vmsish 'hushed';
16           no vmsish 'hushed';
17           vmsish::hushed($hush);
18
19           use vmsish;
20           no vmsish 'time';
21

DESCRIPTION

23       If no import list is supplied, all possible VMS-specific features are
24       assumed.  Currently, there are four VMS-specific features available:
25       'status' (a.k.a '$?'), 'exit', 'time' and 'hushed'.
26
27       If you're not running VMS, this module does nothing.
28
29       "vmsish status"
30             This makes $? and "system" return the native VMS exit status
31             instead of emulating the POSIX exit status.
32
33       "vmsish exit"
34             This makes "exit 1" produce a successful exit (with status
35             SS$_NORMAL), instead of emulating UNIX exit(), which considers
36             "exit 1" to indicate an error.  As with the CRTL's exit()
37             function, "exit 0" is also mapped to an exit status of
38             SS$_NORMAL, and any other argument to exit() is used directly as
39             Perl's exit status.
40
41       "vmsish time"
42             This makes all times relative to the local time zone, instead of
43             the default of Universal Time (a.k.a Greenwich Mean Time, or
44             GMT).
45
46       "vmsish hushed"
47             This suppresses printing of VMS status messages to SYS$OUTPUT and
48             SYS$ERROR if Perl terminates with an error status, and allows
49             programs that are expecting "unix-style" Perl to avoid having to
50             parse VMS error messages.  It does not suppress any messages from
51             Perl itself, just the messages generated by DCL after Perl exits.
52             The DCL symbol $STATUS will still have the termination status,
53             but with a high-order bit set:
54
55             EXAMPLE:
56                 $ perl -e"exit 44;"                             Non-hushed
57             error exit
58                 %SYSTEM-F-ABORT, abort                          DCL message
59                 $ show sym $STATUS
60                   $STATUS == "%X0000002C"
61
62                 $ perl -e"use vmsish qw(hushed); exit 44;"      Hushed error exit
63                 $ show sym $STATUS
64                   $STATUS == "%X1000002C"
65
66             The 'hushed' flag has a global scope during compilation: the
67             exit() or die() commands that are compiled after 'vmsish hushed'
68             will be hushed when they are executed.  Doing a "no vmsish
69             'hushed'" turns off the hushed flag.
70
71             The status of the hushed flag also affects output of VMS error
72             messages from compilation errors.   Again, you still get the Perl
73             error message (and the code in $STATUS)
74
75             EXAMPLE:
76                 use vmsish 'hushed';    # turn on hushed flag
77                 use Carp;          # Carp compiled hushed
78                 exit 44;           # will be hushed
79                 croak('I die');    # will be hushed
80                 no vmsish 'hushed';     # turn off hushed flag
81                 exit 44;           # will not be hushed
82                 croak('I die2'):   # WILL be hushed, croak was compiled
83             hushed
84
85             You can also control the 'hushed' flag at run-time, using the
86             built-in routine vmsish::hushed().  Without argument, it returns
87             the hushed status.  Since vmsish::hushed is built-in, you do not
88             need to "use vmsish" to call it.
89
90             EXAMPLE:
91                 if ($quiet_exit) {
92                     vmsish::hushed(1);
93                 }
94                 print "Sssshhhh...I'm hushed...\n" if vmsish::hushed();
95                 exit 44;
96
97             Note that an exit() or die() that is compiled 'hushed' because of
98             "use vmsish" is not un-hushed by calling vmsish::hushed(0) at
99             runtime.
100
101             The messages from error exits from inside the Perl core are
102             generally more serious, and are not suppressed.
103
104       See "Perl Modules" in perlmod.
105
106
107
108perl v5.16.3                      2013-03-04                       vmsish(3pm)
Impressum