Debian Codegraph @

upstream/mageia-cauldron/man3pm/vmsish.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (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 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "vmsish 3pm"
61 .TH vmsish 3pm 2023-12-22 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 vmsish \- Perl pragma to control VMS\-specific language features
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& use vmsish;
72 \&
73 \& use vmsish \*(Aqstatus\*(Aq; # or \*(Aq$?\*(Aq
74 \& use vmsish \*(Aqexit\*(Aq;
75 \& use vmsish \*(Aqtime\*(Aq;
76 \&
77 \& use vmsish \*(Aqhushed\*(Aq;
78 \& no vmsish \*(Aqhushed\*(Aq;
79 \& vmsish::hushed($hush);
80 \&
81 \& use vmsish;
82 \& no vmsish \*(Aqtime\*(Aq;
83 .Ve
84 .SH DESCRIPTION
85 .IX Header "DESCRIPTION"
86 If no import list is supplied, all possible VMS\-specific features are
87 assumed. Currently, there are four VMS\-specific features available:
88 \&\*(Aqstatus\*(Aq (a.k.a \*(Aq$?\*(Aq), \*(Aqexit\*(Aq, \*(Aqtime\*(Aq and \*(Aqhushed\*(Aq.
89 .PP
90 If you\*(Aqre not running VMS, this module does nothing.
91 .ie n .IP """vmsish status""" 6
92 .el .IP "\f(CWvmsish status\fR" 6
93 .IX Item "vmsish status"
94 This makes \f(CW$?\fR and \f(CW\*(C`system\*(C'\fR return the native VMS exit status
95 instead of emulating the POSIX exit status.
96 .ie n .IP """vmsish exit""" 6
97 .el .IP "\f(CWvmsish exit\fR" 6
98 .IX Item "vmsish exit"
99 This makes \f(CW\*(C`exit 1\*(C'\fR produce a successful exit (with status SS$_NORMAL),
100 instead of emulating UNIX \fBexit()\fR, which considers \f(CW\*(C`exit 1\*(C'\fR to indicate
101 an error. As with the CRTL\*(Aqs \fBexit()\fR function, \f(CW\*(C`exit 0\*(C'\fR is also mapped
102 to an exit status of SS$_NORMAL, and any other argument to \fBexit()\fR is
103 used directly as Perl\*(Aqs exit status.
104 .ie n .IP """vmsish time""" 6
105 .el .IP "\f(CWvmsish time\fR" 6
106 .IX Item "vmsish time"
107 This makes all times relative to the local time zone, instead of the
108 default of Universal Time (a.k.a Greenwich Mean Time, or GMT).
109 .ie n .IP """vmsish hushed""" 6
110 .el .IP "\f(CWvmsish hushed\fR" 6
111 .IX Item "vmsish hushed"
112 This suppresses printing of VMS status messages to SYS$OUTPUT and
113 SYS$ERROR if Perl terminates with an error status, and allows
114 programs that are expecting "unix\-style" Perl to avoid having to parse
115 VMS error messages. It does not suppress any messages from Perl
116 itself, just the messages generated by DCL after Perl exits. The DCL
117 symbol \f(CW$STATUS\fR will still have the termination status, but with a
118 high\-order bit set:
119 .Sp
120 EXAMPLE:
121 $ perl \-e"exit 44;" Non\-hushed error exit
122 \f(CW%SYSTEM\fR\-F\-ABORT, abort DCL message
123 $ show sym \f(CW$STATUS\fR
124 \f(CW$STATUS\fR == "%X0000002C"
125 .Sp
126 .Vb 3
127 \& $ perl \-e"use vmsish qw(hushed); exit 44;" Hushed error exit
128 \& $ show sym $STATUS
129 \& $STATUS == "%X1000002C"
130 .Ve
131 .Sp
132 The \*(Aqhushed\*(Aq flag has a global scope during compilation: the \fBexit()\fR or
133 \&\fBdie()\fR commands that are compiled after \*(Aqvmsish hushed\*(Aq will be hushed
134 when they are executed. Doing a "no vmsish \*(Aqhushed\*(Aq" turns off the
135 hushed flag.
136 .Sp
137 The status of the hushed flag also affects output of VMS error
138 messages from compilation errors. Again, you still get the Perl
139 error message (and the code in \f(CW$STATUS\fR)
140 .Sp
141 EXAMPLE:
142 use vmsish \*(Aqhushed\*(Aq; # turn on hushed flag
143 use Carp; # Carp compiled hushed
144 exit 44; # will be hushed
145 croak(\*(AqI die\*(Aq); # will be hushed
146 no vmsish \*(Aqhushed\*(Aq; # turn off hushed flag
147 exit 44; # will not be hushed
148 croak(\*(AqI die2\*(Aq): # WILL be hushed, croak was compiled hushed
149 .Sp
150 You can also control the \*(Aqhushed\*(Aq flag at run\-time, using the built\-in
151 routine \fBvmsish::hushed()\fR. Without argument, it returns the hushed status.
152 Since vmsish::hushed is built\-in, you do not need to "use vmsish" to call
153 it.
154 .Sp
155 EXAMPLE:
156 if ($quiet_exit) {
157 \fBvmsish::hushed\fR\|(1);
158 }
159 print "Sssshhhh...I\*(Aqm hushed...\en" if \fBvmsish::hushed()\fR;
160 exit 44;
161 .Sp
162 Note that an \fBexit()\fR or \fBdie()\fR that is compiled \*(Aqhushed\*(Aq because of "use
163 vmsish" is not un\-hushed by calling \fBvmsish::hushed\fR\|(0) at runtime.
164 .Sp
165 The messages from error exits from inside the Perl core are generally
166 more serious, and are not suppressed.
167 .PP
168 See "Perl Modules" in perlmod.