English - use nice English (or awk) names for ugly punctuation variables
use English qw( -no_match_vars ) ; # Avoids regex performance penalty
if ($ERRNO =~ /denied/) { ... }
This module provides aliases for the built-in variables whose
names no one seems to like to read. Variables with side-effects
which get triggered just by accessing them (like $0) will still
For those variables that have an B<awk> version, both long
and short English alternatives are provided. For example,
the C<$/> variable can be referred to either $RS or
$INPUT_RECORD_SEPARATOR if you are using the English module.
See L<perlvar> for a complete list of these.
This module can provoke sizeable inefficiencies for regular expressions,
due to unfortunate implementation details. If performance matters in
your application and you don't need $PREMATCH, $MATCH, or $POSTMATCH,
use English qw( -no_match_vars ) ;
. B<It is especially important to do this in modules to avoid penalizing
all applications which use them.>
# Grandfather $NAME import
my @list = grep { ! /^-no_match_vars$/ } @_ ;
local $Exporter::ExportLevel
= 1;
*EXPORT
= \
@COMPLETE_EXPORT ;
Carp
::croak
"Can't create English for match leftovers: $@" ;
*EXPORT
= \
@MINIMAL_EXPORT ;
Exporter
::import
($this,grep {s/^\$/*/} @list);
*FORMAT_LINE_BREAK_CHARACTERS
@COMPLETE_EXPORT = ( @MINIMAL_EXPORT, @MATCH_EXPORT ) ;
# The ground of all being. @ARG is deprecated (5.005 makes @_ lexical)
*LAST_SUBMATCH_RESULT
= *^N
;
*LAST_MATCH_START
= *-{ARRAY
} ;
*LAST_MATCH_END
= *+{ARRAY
} ;
*INPUT_LINE_NUMBER
= *. ;
*INPUT_RECORD_SEPARATOR
= */ ;
*OUTPUT_FIELD_SEPARATOR
= *, ;
*OUTPUT_RECORD_SEPARATOR
= *\
;
# Interpolation "constants".
*SUBSCRIPT_SEPARATOR = *; ;
*FORMAT_PAGE_NUMBER = *% ;
*FORMAT_LINES_PER_PAGE = *= ;
*FORMAT_LINES_LEFT = *- ;
*FORMAT_LINE_BREAK_CHARACTERS = *: ;
*EXTENDED_OS_ERROR = *^E ;
*EFFECTIVE_USER_ID = *> ;
*EFFECTIVE_GROUP_ID = *) ;
*LAST_REGEXP_CODE_RESULT = *^R ;
*EXCEPTIONS_BEING_CAUGHT = *^S ;
# *MULTILINE_MATCHING = ** ;
# *OLD_PERL_VERSION = *] ;