5 vmsish - Perl pragma to control VMS-specific language features
11 use vmsish 'status'; # or '$?'
21 If no import list is supplied, all possible VMS-specific features are
22 assumed. Currently, there are four VMS-specific features available:
23 'status' (a.k.a '$?'), 'exit', 'time' and 'hushed'.
27 =item C<vmsish status>
29 This makes C<$?> and C<system> return the native VMS exit status
30 instead of emulating the POSIX exit status.
34 This makes C<exit 1> produce a successful exit (with status SS$_NORMAL),
35 instead of emulating UNIX exit(), which considers C<exit 1> to indicate
36 an error. As with the CRTL's exit() function, C<exit 0> is also mapped
37 to an exit status of SS$_NORMAL, and any other argument to exit() is
38 used directly as Perl's exit status.
42 This makes all times relative to the local time zone, instead of the
43 default of Universal Time (a.k.a Greenwich Mean Time, or GMT).
45 =item C<vmsish hushed>
47 This suppresses printing of VMS status messages to SYS$OUTPUT and SYS$ERROR
48 if Perl terminates with an error status. This primarily effects error
49 exits from things like Perl compiler errors or "standard Perl" runtime errors,
50 where text error messages are also generated by Perl.
52 The error exits from inside the core are generally more serious, and are
57 See L<perlmod/Pragmatic Modules>.
63 Carp::croak("This isn't VMS");
69 foreach $sememe (@_) {
70 $bits |= 0x20000000, next if $sememe eq 'hushed';
71 $bits |= 0x40000000, next if $sememe eq 'status' || $sememe eq '$?';
72 $bits |= 0x80000000, next if $sememe eq 'time';
79 $^H |= bits(@_ ? @_ : qw(status time hushed));
82 foreach $sememe (@_ ? @_ : qw(exit)) {
83 $^H{'vmsish_exit'} = 1 if $sememe eq 'exit';
89 $^H &= ~ bits(@_ ? @_ : qw(status time hushed));
92 foreach $sememe (@_ ? @_ : qw(exit)) {
93 $^H{'vmsish_exit'} = 0 if $sememe eq 'exit';