Last Modified
2016-11-15 11:15:56 -0600


frozen_string_literal: false

Include the English library file in a Ruby script, and you can
reference the global variables such as \VAR{\$\_} using less
cryptic names, listed in the following table.% \vref{tab:english}.

Without 'English':

    $\ = ' -- '
    "waterbuffalo" =~ /buff/
    print $', $$, "\n"

With English:

    require "English"

    "waterbuffalo" =~ /buff/
    print $POSTMATCH, $PID, "\n"

Below is a full list of descriptive aliases and their associated global

$ERROR_INFO::              $!
$ERROR_POSITION::          $@
$FS::                      $;
$FIELD_SEPARATOR::         $;
$OFS::                     $,
$RS::                      $/
$ORS::                     $\
$NR::                      $.
$LAST_READ_LINE::          $_
$DEFAULT_OUTPUT::          $>
$DEFAULT_INPUT::           $<
$PID::                     $$
$PROCESS_ID::              $$
$CHILD_STATUS::            $?
$LAST_MATCH_INFO::         $~
$IGNORECASE::              $=
$ARGV::                    $*
$MATCH::                   $&
$PREMATCH::                $`
$POSTMATCH::               $'
$LAST_PAREN_MATCH::        $+

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit

blog comments powered by Disqus