Debian Codegraph @

upstream/debian-unstable/man3/vmsish.3perl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "vmsish 3perl"
58 .TH vmsish 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 vmsish \- Perl pragma to control VMS\-specific language features
65 .SH SYNOPSIS
66 .IX Header "SYNOPSIS"
67 .Vb 1
68 \& use vmsish;
69 \&
70 \& use vmsish \*(Aqstatus\*(Aq; # or \*(Aq$?\*(Aq
71 \& use vmsish \*(Aqexit\*(Aq;
72 \& use vmsish \*(Aqtime\*(Aq;
73 \&
74 \& use vmsish \*(Aqhushed\*(Aq;
75 \& no vmsish \*(Aqhushed\*(Aq;
76 \& vmsish::hushed($hush);
77 \&
78 \& use vmsish;
79 \& no vmsish \*(Aqtime\*(Aq;
80 .Ve
81 .SH DESCRIPTION
82 .IX Header "DESCRIPTION"
83 If no import list is supplied, all possible VMS-specific features are
84 assumed. Currently, there are four VMS-specific features available:
85 \&'status' (a.k.a '$?'), 'exit', 'time' and 'hushed'.
86 .PP
87 If you're not running VMS, this module does nothing.
88 .ie n .IP """vmsish status""" 6
89 .el .IP "\f(CWvmsish status\fR" 6
90 .IX Item "vmsish status"
91 This makes \f(CW$?\fR and \f(CW\*(C`system\*(C'\fR return the native VMS exit status
92 instead of emulating the POSIX exit status.
93 .ie n .IP """vmsish exit""" 6
94 .el .IP "\f(CWvmsish exit\fR" 6
95 .IX Item "vmsish exit"
96 This makes \f(CW\*(C`exit 1\*(C'\fR produce a successful exit (with status SS$_NORMAL),
97 instead of emulating UNIX \fBexit()\fR, which considers \f(CW\*(C`exit 1\*(C'\fR to indicate
98 an error. As with the CRTL's \fBexit()\fR function, \f(CW\*(C`exit 0\*(C'\fR is also mapped
99 to an exit status of SS$_NORMAL, and any other argument to \fBexit()\fR is
100 used directly as Perl's exit status.
101 .ie n .IP """vmsish time""" 6
102 .el .IP "\f(CWvmsish time\fR" 6
103 .IX Item "vmsish time"
104 This makes all times relative to the local time zone, instead of the
105 default of Universal Time (a.k.a Greenwich Mean Time, or GMT).
106 .ie n .IP """vmsish hushed""" 6
107 .el .IP "\f(CWvmsish hushed\fR" 6
108 .IX Item "vmsish hushed"
109 This suppresses printing of VMS status messages to SYS$OUTPUT and
110 SYS$ERROR if Perl terminates with an error status, and allows
111 programs that are expecting "unix-style" Perl to avoid having to parse
112 VMS error messages. It does not suppress any messages from Perl
113 itself, just the messages generated by DCL after Perl exits. The DCL
114 symbol \f(CW$STATUS\fR will still have the termination status, but with a
115 high-order bit set:
116 .Sp
117 EXAMPLE:
118 $ perl \-e"exit 44;" Non-hushed error exit
119 \f(CW%SYSTEM\fR\-F\-ABORT, abort DCL message
120 $ show sym \f(CW$STATUS\fR
121 \f(CW$STATUS\fR == "%X0000002C"
122 .Sp
123 .Vb 3
124 \& $ perl \-e"use vmsish qw(hushed); exit 44;" Hushed error exit
125 \& $ show sym $STATUS
126 \& $STATUS == "%X1000002C"
127 .Ve
128 .Sp
129 The 'hushed' flag has a global scope during compilation: the \fBexit()\fR or
130 \&\fBdie()\fR commands that are compiled after 'vmsish hushed' will be hushed
131 when they are executed. Doing a "no vmsish 'hushed'" turns off the
132 hushed flag.
133 .Sp
134 The status of the hushed flag also affects output of VMS error
135 messages from compilation errors. Again, you still get the Perl
136 error message (and the code in \f(CW$STATUS\fR)
137 .Sp
138 EXAMPLE:
139 use vmsish 'hushed'; # turn on hushed flag
140 use Carp; # Carp compiled hushed
141 exit 44; # will be hushed
142 croak('I die'); # will be hushed
143 no vmsish 'hushed'; # turn off hushed flag
144 exit 44; # will not be hushed
145 croak('I die2'): # WILL be hushed, croak was compiled hushed
146 .Sp
147 You can also control the 'hushed' flag at run-time, using the built-in
148 routine \fBvmsish::hushed()\fR. Without argument, it returns the hushed status.
149 Since vmsish::hushed is built-in, you do not need to "use vmsish" to call
150 it.
151 .Sp
152 EXAMPLE:
153 if ($quiet_exit) {
154 \fBvmsish::hushed\fR\|(1);
155 }
156 print "Sssshhhh...I'm hushed...\en" if \fBvmsish::hushed()\fR;
157 exit 44;
158 .Sp
159 Note that an \fBexit()\fR or \fBdie()\fR that is compiled 'hushed' because of "use
160 vmsish" is not un-hushed by calling \fBvmsish::hushed\fR\|(0) at runtime.
161 .Sp
162 The messages from error exits from inside the Perl core are generally
163 more serious, and are not suppressed.
164 .PP
165 See "Perl Modules" in perlmod.