📄 vmsish.pm
字号:
package vmsish;=head1 NAMEvmsish - Perl pragma to control VMS-specific language features=head1 SYNOPSIS use vmsish; use vmsish 'status'; # or '$?' use vmsish 'exit'; use vmsish 'time'; use vmsish 'hushed'; use vmsish; no vmsish 'time';=head1 DESCRIPTIONIf no import list is supplied, all possible VMS-specific features areassumed. Currently, there are four VMS-specific features available:'status' (a.k.a '$?'), 'exit', 'time' and 'hushed'.=over 6=item C<vmsish status>This makes C<$?> and C<system> return the native VMS exit statusinstead of emulating the POSIX exit status.=item C<vmsish exit>This makes C<exit 1> produce a successful exit (with status SS$_NORMAL),instead of emulating UNIX exit(), which considers C<exit 1> to indicatean error. As with the CRTL's exit() function, C<exit 0> is also mappedto an exit status of SS$_NORMAL, and any other argument to exit() isused directly as Perl's exit status.=item C<vmsish time>This makes all times relative to the local time zone, instead of thedefault of Universal Time (a.k.a Greenwich Mean Time, or GMT).=item C<vmsish hushed>This supresses printing of VMS status messages to SYS$OUTPUT and SYS$ERRORif Perl terminates with an error status. This primarily effects errorexits from things like compiler errors or "standard Perl" runtime errors,where text error messages are also generated by Perl.The error exits from inside VMS.C are generally more serious, and arenot supressed.=backSee L<perlmod/Pragmatic Modules>.=cutif ($^O ne 'VMS') { require Carp; Carp::croak("This isn't VMS");}sub bits { my $bits = 0; my $sememe; foreach $sememe (@_) { $bits |= 0x20000000, next if $sememe eq 'hushed'; $bits |= 0x40000000, next if $sememe eq 'status' || $sememe eq '$?'; $bits |= 0x80000000, next if $sememe eq 'time'; } $bits;}sub import { shift; $^H |= bits(@_ ? @_ : qw(status time hushed)); my $sememe; foreach $sememe (@_ ? @_ : qw(exit)) { $^H{'vmsish_exit'} = 1 if $sememe eq 'exit'; }}sub unimport { shift; $^H &= ~ bits(@_ ? @_ : qw(status time hushed)); my $sememe; foreach $sememe (@_ ? @_ : qw(exit)) { $^H{'vmsish_exit'} = 0 if $sememe eq 'exit'; }}1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -