10 English - use nice English (or awk) names for ugly punctuation variables
14 use English qw( -no_match_vars ) ; # Avoids regex performance penalty
17 if ($ERRNO =~ /denied/) { ... }
21 This module provides aliases for the built-in variables whose
22 names no one seems to like to read. Variables with side-effects
23 which get triggered just by accessing them (like $0) will still
26 For those variables that have an B<awk> version, both long
27 and short English alternatives are provided. For example,
28 the C<$/> variable can be referred to either $RS or
29 $INPUT_RECORD_SEPARATOR if you are using the English module.
31 See L<perlvar> for a complete list of these.
35 This module can provoke sizeable inefficiencies for regular expressions,
36 due to unfortunate implementation details. If performance matters in
37 your application and you don't need $PREMATCH, $MATCH, or $POSTMATCH,
40 use English qw( -no_match_vars ) ;
42 . B<It is especially important to do this in modules to avoid penalizing
43 all applications which use them.>
51 # Grandfather $NAME import
54 my @list = grep { ! /^-no_match_vars$/ } @_ ;
55 local $Exporter::ExportLevel = 1;
57 *EXPORT = \@COMPLETE_EXPORT ;
67 Carp::croak("Can't create English for match leftovers: $@") ;
72 *EXPORT = \@MINIMAL_EXPORT ;
74 Exporter::import($this,grep {s/^\$/*/} @list);
82 *INPUT_RECORD_SEPARATOR
85 *OUTPUT_FIELD_SEPARATOR
87 *OUTPUT_RECORD_SEPARATOR
93 *FORMAT_LINES_PER_PAGE
97 *FORMAT_LINE_BREAK_CHARACTERS
126 *LAST_REGEXP_CODE_RESULT
127 *EXCEPTIONS_BEING_CAUGHT
128 *LAST_SUBMATCH_RESULT
140 @COMPLETE_EXPORT = ( @MINIMAL_EXPORT, @MATCH_EXPORT ) ;
142 # The ground of all being. @ARG is deprecated (5.005 makes @_ lexical)
148 *LAST_PAREN_MATCH = *+ ;
149 *LAST_SUBMATCH_RESULT = *^N ;
150 *LAST_MATCH_START = *-{ARRAY} ;
151 *LAST_MATCH_END = *+{ARRAY} ;
155 *INPUT_LINE_NUMBER = *. ;
157 *INPUT_RECORD_SEPARATOR = */ ;
162 *OUTPUT_AUTOFLUSH = *| ;
163 *OUTPUT_FIELD_SEPARATOR = *, ;
165 *OUTPUT_RECORD_SEPARATOR = *\ ;
168 # Interpolation "constants".
170 *LIST_SEPARATOR = *" ;
171 *SUBSCRIPT_SEPARATOR = *; ;
176 *FORMAT_PAGE_NUMBER = *% ;
177 *FORMAT_LINES_PER_PAGE = *= ;
178 *FORMAT_LINES_LEFT = *- ;
180 *FORMAT_TOP_NAME = *^ ;
181 *FORMAT_LINE_BREAK_CHARACTERS = *: ;
182 *FORMAT_FORMFEED = *^L ;
191 *EXTENDED_OS_ERROR = *^E ;
200 *EFFECTIVE_USER_ID = *> ;
202 *REAL_GROUP_ID = *( ;
204 *EFFECTIVE_GROUP_ID = *) ;
210 *PERL_VERSION = *^V ;
214 *SYSTEM_FD_MAX = *^F ;
215 *INPLACE_EDIT = *^I ;
217 *LAST_REGEXP_CODE_RESULT = *^R ;
218 *EXCEPTIONS_BEING_CAUGHT = *^S ;
221 *EXECUTABLE_NAME = *^X ;
228 # *OLD_PERL_VERSION = *] ;