8 English - use nice English (or awk) names for ugly punctuation variables
12 use English qw( -no_match_vars ) ; # Avoids regex performance penalty
15 if ($ERRNO =~ /denied/) { ... }
19 This module provides aliases for the built-in variables whose
20 names no one seems to like to read. Variables with side-effects
21 which get triggered just by accessing them (like $0) will still
24 For those variables that have an B<awk> version, both long
25 and short English alternatives are provided. For example,
26 the C<$/> variable can be referred to either $RS or
27 $INPUT_RECORD_SEPARATOR if you are using the English module.
29 See L<perlvar> for a complete list of these.
33 This module can provoke sizeable inefficiencies for regular expressions,
34 due to unfortunate implementation details. If performance matters in
35 your application and you don't need $PREMATCH, $MATCH, or $POSTMATCH,
38 use English qw( -no_match_vars ) ;
40 . B<It is especially important to do this in modules to avoid penalizing
41 all applications which use them.>
49 # Grandfather $NAME import
52 my @list = grep { ! /^-no_match_vars$/ } @_ ;
53 local $Exporter::ExportLevel = 1;
55 *EXPORT = \@COMPLETE_EXPORT ;
65 Carp::croak "Can't create English for match leftovers: $@" ;
70 *EXPORT = \@MINIMAL_EXPORT ;
72 Exporter::import($this,grep {s/^\$/*/} @list);
80 *INPUT_RECORD_SEPARATOR
83 *OUTPUT_FIELD_SEPARATOR
85 *OUTPUT_RECORD_SEPARATOR
91 *FORMAT_LINES_PER_PAGE
95 *FORMAT_LINE_BREAK_CHARACTERS
123 *LAST_REGEXP_CODE_RESULT
124 *EXCEPTIONS_BEING_CAUGHT
136 @COMPLETE_EXPORT = ( @MINIMAL_EXPORT, @MATCH_EXPORT ) ;
138 # The ground of all being. @ARG is deprecated (5.005 makes @_ lexical)
144 *LAST_PAREN_MATCH = *+ ;
145 *LAST_MATCH_START = *-{ARRAY} ;
146 *LAST_MATCH_END = *+{ARRAY} ;
150 *INPUT_LINE_NUMBER = *. ;
152 *INPUT_RECORD_SEPARATOR = */ ;
157 *OUTPUT_AUTOFLUSH = *| ;
158 *OUTPUT_FIELD_SEPARATOR = *, ;
160 *OUTPUT_RECORD_SEPARATOR = *\ ;
163 # Interpolation "constants".
165 *LIST_SEPARATOR = *" ;
166 *SUBSCRIPT_SEPARATOR = *; ;
171 *FORMAT_PAGE_NUMBER = *% ;
172 *FORMAT_LINES_PER_PAGE = *= ;
173 *FORMAT_LINES_LEFT = *- ;
175 *FORMAT_TOP_NAME = *^ ;
176 *FORMAT_LINE_BREAK_CHARACTERS = *: ;
177 *FORMAT_FORMFEED = *^L ;
184 *EXTENDED_OS_ERROR = *^E ;
193 *EFFECTIVE_USER_ID = *> ;
195 *REAL_GROUP_ID = *( ;
197 *EFFECTIVE_GROUP_ID = *) ;
203 *PERL_VERSION = *^V ;
207 *SYSTEM_FD_MAX = *^F ;
208 *INPLACE_EDIT = *^I ;
210 *LAST_REGEXP_CODE_RESULT = *^R ;
211 *EXCEPTIONS_BEING_CAUGHT = *^S ;
214 *EXECUTABLE_NAME = *^X ;
221 # *MULTILINE_MATCHING = ** ;
222 # *OLD_PERL_VERSION = *] ;