Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

194 lines
3.8 KiB

  1. package English;
  2. require Exporter;
  3. @ISA = (Exporter);
  4. =head1 NAME
  5. English - use nice English (or awk) names for ugly punctuation variables
  6. =head1 SYNOPSIS
  7. use English;
  8. ...
  9. if ($ERRNO =~ /denied/) { ... }
  10. =head1 DESCRIPTION
  11. This module provides aliases for the built-in variables whose
  12. names no one seems to like to read. Variables with side-effects
  13. which get triggered just by accessing them (like $0) will still
  14. be affected.
  15. For those variables that have an B<awk> version, both long
  16. and short English alternatives are provided. For example,
  17. the C<$/> variable can be referred to either $RS or
  18. $INPUT_RECORD_SEPARATOR if you are using the English module.
  19. See L<perlvar> for a complete list of these.
  20. =head1 BUGS
  21. This module provokes sizeable inefficiencies for regular expressions,
  22. due to unfortunate implementation details. If performance matters,
  23. consider avoiding English.
  24. =cut
  25. no warnings;
  26. # Grandfather $NAME import
  27. sub import {
  28. my $this = shift;
  29. my @list = @_;
  30. local $Exporter::ExportLevel = 1;
  31. Exporter::import($this,grep {s/^\$/*/} @list);
  32. }
  33. @EXPORT = qw(
  34. *ARG
  35. *MATCH
  36. *PREMATCH
  37. *POSTMATCH
  38. *LAST_PAREN_MATCH
  39. *INPUT_LINE_NUMBER
  40. *NR
  41. *INPUT_RECORD_SEPARATOR
  42. *RS
  43. *OUTPUT_AUTOFLUSH
  44. *OUTPUT_FIELD_SEPARATOR
  45. *OFS
  46. *OUTPUT_RECORD_SEPARATOR
  47. *ORS
  48. *LIST_SEPARATOR
  49. *SUBSCRIPT_SEPARATOR
  50. *SUBSEP
  51. *FORMAT_PAGE_NUMBER
  52. *FORMAT_LINES_PER_PAGE
  53. *FORMAT_LINES_LEFT
  54. *FORMAT_NAME
  55. *FORMAT_TOP_NAME
  56. *FORMAT_LINE_BREAK_CHARACTERS
  57. *FORMAT_FORMFEED
  58. *CHILD_ERROR
  59. *OS_ERROR
  60. *ERRNO
  61. *EXTENDED_OS_ERROR
  62. *EVAL_ERROR
  63. *PROCESS_ID
  64. *PID
  65. *REAL_USER_ID
  66. *UID
  67. *EFFECTIVE_USER_ID
  68. *EUID
  69. *REAL_GROUP_ID
  70. *GID
  71. *EFFECTIVE_GROUP_ID
  72. *EGID
  73. *PROGRAM_NAME
  74. *PERL_VERSION
  75. *ACCUMULATOR
  76. *DEBUGGING
  77. *SYSTEM_FD_MAX
  78. *INPLACE_EDIT
  79. *PERLDB
  80. *BASETIME
  81. *WARNING
  82. *EXECUTABLE_NAME
  83. *OSNAME
  84. *LAST_REGEXP_CODE_RESULT
  85. *EXCEPTIONS_BEING_CAUGHT
  86. @LAST_MATCH_START
  87. @LAST_MATCH_END
  88. );
  89. # The ground of all being. @ARG is deprecated (5.005 makes @_ lexical)
  90. *ARG = *_ ;
  91. # Matching.
  92. *MATCH = *& ;
  93. *PREMATCH = *` ;
  94. *POSTMATCH = *' ;
  95. *LAST_PAREN_MATCH = *+ ;
  96. *LAST_MATCH_START = *-{ARRAY} ;
  97. *LAST_MATCH_END = *+{ARRAY} ;
  98. # Input.
  99. *INPUT_LINE_NUMBER = *. ;
  100. *NR = *. ;
  101. *INPUT_RECORD_SEPARATOR = */ ;
  102. *RS = */ ;
  103. # Output.
  104. *OUTPUT_AUTOFLUSH = *| ;
  105. *OUTPUT_FIELD_SEPARATOR = *, ;
  106. *OFS = *, ;
  107. *OUTPUT_RECORD_SEPARATOR = *\ ;
  108. *ORS = *\ ;
  109. # Interpolation "constants".
  110. *LIST_SEPARATOR = *" ;
  111. *SUBSCRIPT_SEPARATOR = *; ;
  112. *SUBSEP = *; ;
  113. # Formats
  114. *FORMAT_PAGE_NUMBER = *% ;
  115. *FORMAT_LINES_PER_PAGE = *= ;
  116. *FORMAT_LINES_LEFT = *- ;
  117. *FORMAT_NAME = *~ ;
  118. *FORMAT_TOP_NAME = *^ ;
  119. *FORMAT_LINE_BREAK_CHARACTERS = *: ;
  120. *FORMAT_FORMFEED = *^L ;
  121. # Error status.
  122. *CHILD_ERROR = *? ;
  123. *OS_ERROR = *! ;
  124. *ERRNO = *! ;
  125. *EXTENDED_OS_ERROR = *^E ;
  126. *EVAL_ERROR = *@ ;
  127. # Process info.
  128. *PROCESS_ID = *$ ;
  129. *PID = *$ ;
  130. *REAL_USER_ID = *< ;
  131. *UID = *< ;
  132. *EFFECTIVE_USER_ID = *> ;
  133. *EUID = *> ;
  134. *REAL_GROUP_ID = *( ;
  135. *GID = *( ;
  136. *EFFECTIVE_GROUP_ID = *) ;
  137. *EGID = *) ;
  138. *PROGRAM_NAME = *0 ;
  139. # Internals.
  140. *PERL_VERSION = *^V ;
  141. *ACCUMULATOR = *^A ;
  142. *COMPILING = *^C ;
  143. *DEBUGGING = *^D ;
  144. *SYSTEM_FD_MAX = *^F ;
  145. *INPLACE_EDIT = *^I ;
  146. *PERLDB = *^P ;
  147. *LAST_REGEXP_CODE_RESULT = *^R ;
  148. *EXCEPTIONS_BEING_CAUGHT = *^S ;
  149. *BASETIME = *^T ;
  150. *WARNING = *^W ;
  151. *EXECUTABLE_NAME = *^X ;
  152. *OSNAME = *^O ;
  153. # Deprecated.
  154. # *ARRAY_BASE = *[ ;
  155. # *OFMT = *# ;
  156. # *MULTILINE_MATCHING = ** ;
  157. # *OLD_PERL_VERSION = *] ;
  158. 1;