vmsish(3perl)
π vmsish β the Perl pragma that controls VMS-specific language features π
okay so bestie, this is from the Perl Programmers Reference Guide, and it's literally a pragma for controlling the VMS-flavored language features. if you're on VMS, this is your moment. if you're not... it's giving nothing, and I mean that affectionately (more on that in a sec). β¨
πΈ SYNOPSIS πΈ
use vmsish;
use vmsish 'status'; # or '$?'
use vmsish 'exit';
use vmsish 'time';
use vmsish 'hushed';
no vmsish 'hushed';
vmsish::hushed($hush);
use vmsish;
no vmsish 'time';
π¦ DESCRIPTION π¦
So, if you don't hand it an import list at all? It assumes every single VMS-specific feature, no cap. And rn there are four VMS-specific features on the menu: 'status' (a.k.a. '$?'), 'exit', 'time', and 'hushed'.
Not running VMS? This module does absolutely nothing. Zero. It's a vibe check it doesn't even show up for. π
π vmsish status
This one makes $? and system return the native VMS exit status instead of doing that whole emulated POSIX exit status thing. native > cosplay, fr fr.
π
vmsish exit
This makes exit 1 produce a successful exit (with status SS$_NORMAL), instead of emulating UNIX exit(), which is out here considering exit 1 to mean "an error happened". rude of it honestly.
Same energy as the CRTL's exit() function: exit 0 also gets mapped to an exit status of SS$_NORMAL, and literally any other argument to exit() just gets used directly as Perl's exit status. iconic behavior.
β vmsish time
This makes all times relative to the local time zone, instead of defaulting to Universal Time (a.k.a. Greenwich Mean Time, or GMT). your timezone, your rules. periodt. π°οΈ
π vmsish hushed
Okay this is the main character of the page, so let's get into it.
This suppresses printing of VMS status messages to SYS$OUTPUT and SYS$ERROR if Perl terminates with an error status, and it lets programs that are expecting "unix-style" Perl avoid having to parse VMS error messages. Not me saving you from regexing your own error output π«Ά
Important though: it does not suppress any messages from Perl itself β just the messages generated by DCL after Perl exits. And the DCL symbol $STATUS still has the termination status, but with a high-order bit set:
EXAMPLE:
$ perl -e"exit 44;" Non-hushed error
exit
%SYSTEM-F-ABORT, abort DCL message
$ show sym $STATUS
$STATUS == "%X0000002C"
$ perl -e"use vmsish qw(hushed); exit 44;" Hushed error exit
$ show sym $STATUS
$STATUS == "%X1000002C"
See that %X0000002C vs %X1000002C? That high-order bit is the whole plot twist. π
The 'hushed' flag has global scope during compilation: the exit() or die() commands that get compiled after 'vmsish hushed' will be hushed when they're executed. And doing a no vmsish 'hushed' turns off the hushed flag.
The status of the hushed flag also affects output of VMS error messages from compilation errors. But again β you still get the Perl error message (and the code in $STATUS).
EXAMPLE:
use vmsish 'hushed'; # turn on hushed flag
use Carp; # Carp compiled hushed
exit 44; # will be hushed
croak('I die'); # will be hushed
no vmsish 'hushed'; # turn off hushed flag
exit 44; # will not be hushed
croak('I die2'): # WILL be hushed, croak was compiled hushed
Look at that last line β compiled-hushed croak stays hushed even after you turn the flag off. the audacity. the commitment. π₯
You can also control the 'hushed' flag at run-time, using the built-in routine vmsish::hushed(). With no argument, it returns the hushed status. And since vmsish::hushed is built-in, you do not need to use vmsish to call it. convenient much? β¨
EXAMPLE:
if ($quiet_exit) {
vmsish::hushed(1);
}
print "Sssshhhh...I'm hushed...\n" if vmsish::hushed();
exit 44;
BIG caveat, do not skip this one: anexit()ordie()that was compiled'hushed'because ofuse vmsishis not un-hushed by callingvmsish::hushed(0)at runtime. compiled is compiled, bestie. it said what it said. π
And one more: the messages from error exits from inside the Perl core are generally more serious, and they are not suppressed. those ones are showing up no matter what. sorry. π
See "Perl Modules" in perlmod for more.
okay that's the whole page, mwah π This was pulled from perl v5.44.0, dated 2026-10-17 β so go forth, get hushed, and remember: $STATUS always knows what you did. πβ¨π¦
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms