1# -*- mode: rdoc; coding: utf-8; fill-column: 74; -*-
2
3== Pre-defined variables
4
5$!::   The exception information message set by 'raise'.
6$@::   Array of backtrace of the last exception thrown.
7$&::   The string matched by the last successful match.
8$`::   The string to the left  of the last successful match.
9$'::   The string to the right of the last successful match.
10$+::   The highest group matched by the last successful match.
11$1::   The Nth group of the last successful match. May be > 1.
12$~::   The information about the last match in the current scope.
13$=::   The flag for case insensitive, nil by default.
14$/::   The input record separator, newline by default.
15$\::   The output record separator for the print and IO#write. Default is nil.
16$,::   The output field separator for the print and Array#join.
17$;::   The default separator for String#split.
18$.::   The current input line number of the last file that was read.
19$<::   The virtual concatenation file of the files given on command line (or from $stdin if no files were given).
20$>::   The default output for print, printf. $stdout by default.
21$_::   The last input line of string by gets or readline.
22$0::   Contains the name of the script being executed. May be assignable.
23$*::   Command line arguments given for the script sans args.
24$$::   The process number of the Ruby running this script.
25$?::   The status of the last executed child process.
26$:::   Load path for scripts and binary modules by load or require.
27$"::   The array contains the module names loaded by require.
28$DEBUG::     The debug flag, which is set by the -d switch.  Enabling debug
29             output prints each exception raised to $stderr (but not its
30             backtrace).  Setting this to a true value enables debug output as
31             if -d were given on the command line.  Setting this to a false
32             value disables debug output.
33$FILENAME::  Current input file from $<. Same as $<.filename.
34$LOAD_PATH:: The alias to the $:.
35$stderr::    The current standard error output.
36$stdin::     The current standard input.
37$stdout::    The current standard output.
38$VERBOSE::   The verbose flag, which is set by the -w or -v switch.  Setting
39             this to a true value enables warnings as if -w or -v were given
40             on the command line.  Setting this to nil disables warnings,
41             including from Kernel#warn.
42$-0::  The alias to $/.
43$-a::  True if option -a is set. Read-only variable.
44$-d::  The alias of $DEBUG.  See $DEBUG above for further discusison.
45$-F::  The alias to $;.
46$-i::  In in-place-edit mode, this variable holds the extension, otherwise nil.
47$-I::  The alias to $:.
48$-l::  True if option -l is set. Read-only variable.
49$-p::  True if option -p is set. Read-only variable.
50$-v::  An alias of $VERBOSE.  See $VERBOSE above for further discussion.
51$-w::  An alias of $VERBOSE.  See $VERBOSE above for further discussion.
52
53== Pre-defined global constants
54
55TRUE::              The typical true value.
56FALSE::             The false itself.
57NIL::               The nil itself.
58STDIN::             The standard input. The default value for $stdin.
59STDOUT::            The standard output. The default value for $stdout.
60STDERR::            The standard error output. The default value for $stderr.
61ENV::               The hash contains current environment variables.
62ARGF::              The alias to the $<.
63ARGV::              The alias to the $*.
64DATA::              The file object of the script, pointing just after __END__.
65RUBY_VERSION::      The ruby version string (VERSION was deprecated).
66RUBY_RELEASE_DATE:: The release date string.
67RUBY_PLATFORM::     The platform identifier.
68
69