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$=::   This variable is no longer effective. Deprecated.
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.  This value is
26       thread-local.
27$:::   Load path for scripts and binary modules by load or require.
28$"::   The array contains the module names loaded by require.
29$DEBUG::     The debug flag, which is set by the -d switch.  Enabling debug
30             output prints each exception raised to $stderr (but not its
31             backtrace).  Setting this to a true value enables debug output as
32             if -d were given on the command line.  Setting this to a false
33             value disables debug output.
34$LOADED_FEATURES:: The alias to the $".
35$FILENAME::  Current input file from $<. Same as $<.filename.
36$LOAD_PATH:: The alias to the $:.
37$stderr::    The current standard error output.
38$stdin::     The current standard input.
39$stdout::    The current standard output.
40$VERBOSE::   The verbose flag, which is set by the -w or -v switch.  Setting
41             this to a true value enables warnings as if -w or -v were given
42             on the command line.  Setting this to nil disables warnings,
43             including from Kernel#warn.
44$-0::  The alias to $/.
45$-a::  True if option -a is set. Read-only variable.
46$-d::  The alias of $DEBUG.  See $DEBUG above for further discussion.
47$-F::  The alias to $;.
48$-i::  In in-place-edit mode, this variable holds the extension, otherwise nil.
49$-I::  The alias to $:.
50$-l::  True if option -l is set. Read-only variable.
51$-p::  True if option -p is set. Read-only variable.
52$-v::  An alias of $VERBOSE.  See $VERBOSE above for further discussion.
53$-w::  An alias of $VERBOSE.  See $VERBOSE above for further discussion.
54
55== Pre-defined global constants
56
57TRUE::              The typical true value.
58FALSE::             The false itself.
59NIL::               The nil itself.
60STDIN::             The standard input. The default value for $stdin.
61STDOUT::            The standard output. The default value for $stdout.
62STDERR::            The standard error output. The default value for $stderr.
63ENV::               The hash contains current environment variables.
64ARGF::              The alias to the $<.
65ARGV::              The alias to the $*.
66DATA::              The file object of the script, pointing just after __END__.
67RUBY_VERSION::      The ruby version string (VERSION was deprecated).
68RUBY_RELEASE_DATE:: The release date string.
69RUBY_PLATFORM::     The platform identifier.
70
71