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
125 *LAST_REGEXP_CODE_RESULT
126 *EXCEPTIONS_BEING_CAUGHT
138 @COMPLETE_EXPORT = ( @MINIMAL_EXPORT, @MATCH_EXPORT ) ;
140 # The ground of all being. @ARG is deprecated (5.005 makes @_ lexical)
146 *LAST_PAREN_MATCH = \$+ ;
147 *LAST_MATCH_START = \@- ;
148 *LAST_MATCH_END = \@+ ;
152 *INPUT_LINE_NUMBER = \$. ;
154 *INPUT_RECORD_SEPARATOR = \$/ ;
159 *OUTPUT_AUTOFLUSH = \$| ;
160 *OUTPUT_FIELD_SEPARATOR = \$, ;
162 *OUTPUT_RECORD_SEPARATOR = \$\ ;
165 # Interpolation "constants".
167 *LIST_SEPARATOR = \$" ;
168 *SUBSCRIPT_SEPARATOR = \$; ;
173 *FORMAT_PAGE_NUMBER = \$% ;
174 *FORMAT_LINES_PER_PAGE = \$= ;
175 *FORMAT_LINES_LEFT = \$- ;
177 *FORMAT_TOP_NAME = \$^ ;
178 *FORMAT_LINE_BREAK_CHARACTERS = \$: ;
179 *FORMAT_FORMFEED = \$^L ;
188 *EXTENDED_OS_ERROR = \$^E ;
195 *REAL_USER_ID = \$< ;
197 *EFFECTIVE_USER_ID = \$> ;
199 *REAL_GROUP_ID = \$( ;
201 *EFFECTIVE_GROUP_ID = \$) ;
203 *PROGRAM_NAME = \$0 ;
207 *PERL_VERSION = \$^V ;
208 *ACCUMULATOR = \$^A ;
211 *SYSTEM_FD_MAX = \$^F ;
212 *INPLACE_EDIT = \$^I ;
214 *LAST_REGEXP_CODE_RESULT = \$^R ;
215 *EXCEPTIONS_BEING_CAUGHT = \$^S ;
218 *EXECUTABLE_NAME = \$^X ;
223 # *ARRAY_BASE = \$[ ;
225 # *MULTILINE_MATCHING = \$* ;
226 # *OLD_PERL_VERSION = \$] ;