10 English - use nice English (or awk) names for ugly punctuation variables
15 use English qw( -no_match_vars ) ; # Avoids regex performance penalty
16 # in perl 5.16 and earlier
18 if ($ERRNO =~ /denied/) { ... }
22 This module provides aliases for the built-in variables whose
23 names no one seems to like to read. Variables with side-effects
24 which get triggered just by accessing them (like $0) will still
27 For those variables that have an B<awk> version, both long
28 and short English alternatives are provided. For example,
29 the C<$/> variable can be referred to either $RS or
30 $INPUT_RECORD_SEPARATOR if you are using the English module.
32 See L<perlvar> for a complete list of these.
36 NOTE: This was fixed in perl 5.18. Mentioning these three variables no
37 longer makes a speed difference. This section still applies if your code
38 is to run on perl 5.16 or earlier.
40 This module can provoke sizeable inefficiencies for regular expressions,
41 due to unfortunate implementation details. If performance matters in
42 your application and you don't need $PREMATCH, $MATCH, or $POSTMATCH,
45 use English qw( -no_match_vars ) ;
47 . B<It is especially important to do this in modules to avoid penalizing
48 all applications which use them.>
56 # Grandfather $NAME import
59 my @list = grep { ! /^-no_match_vars$/ } @_ ;
60 local $Exporter::ExportLevel = 1;
62 *EXPORT = \@COMPLETE_EXPORT ;
72 Carp::croak("Can't create English for match leftovers: $@") ;
77 *EXPORT = \@MINIMAL_EXPORT ;
79 Exporter::import($this,grep {s/^\$/*/} @list);
87 *INPUT_RECORD_SEPARATOR
90 *OUTPUT_FIELD_SEPARATOR
92 *OUTPUT_RECORD_SEPARATOR
98 *FORMAT_LINES_PER_PAGE
102 *FORMAT_LINE_BREAK_CHARACTERS
131 *LAST_REGEXP_CODE_RESULT
132 *EXCEPTIONS_BEING_CAUGHT
133 *LAST_SUBMATCH_RESULT
145 @COMPLETE_EXPORT = ( @MINIMAL_EXPORT, @MATCH_EXPORT ) ;
147 # The ground of all being.
153 *LAST_PAREN_MATCH = *+ ;
154 *LAST_SUBMATCH_RESULT = *^N ;
155 *LAST_MATCH_START = *-{ARRAY} ;
156 *LAST_MATCH_END = *+{ARRAY} ;
160 *INPUT_LINE_NUMBER = *. ;
162 *INPUT_RECORD_SEPARATOR = */ ;
167 *OUTPUT_AUTOFLUSH = *| ;
168 *OUTPUT_FIELD_SEPARATOR = *, ;
170 *OUTPUT_RECORD_SEPARATOR = *\ ;
173 # Interpolation "constants".
175 *LIST_SEPARATOR = *" ;
176 *SUBSCRIPT_SEPARATOR = *; ;
181 *FORMAT_PAGE_NUMBER = *% ;
182 *FORMAT_LINES_PER_PAGE = *= ;
183 *FORMAT_LINES_LEFT = *- ;
185 *FORMAT_TOP_NAME = *^ ;
186 *FORMAT_LINE_BREAK_CHARACTERS = *: ;
187 *FORMAT_FORMFEED = *^L ;
196 *EXTENDED_OS_ERROR = *^E ;
205 *EFFECTIVE_USER_ID = *> ;
207 *REAL_GROUP_ID = *( ;
209 *EFFECTIVE_GROUP_ID = *) ;
215 *PERL_VERSION = *^V ;
219 *SYSTEM_FD_MAX = *^F ;
220 *INPLACE_EDIT = *^I ;
222 *LAST_REGEXP_CODE_RESULT = *^R ;
223 *EXCEPTIONS_BEING_CAUGHT = *^S ;
226 *EXECUTABLE_NAME = *^X ;
233 # *OLD_PERL_VERSION = *] ;