OSDN Git Service

Regular updates
[twpd/master.git] / ruby.md
1 ---
2 title: Ruby
3 category: Ruby
4 ---
5
6 * `$!` - latest error message
7 * `$@` - location of error
8 * `$_` - string last read by gets
9 * `$.` - line number last read by interpreter
10 * `$&` - string last matched by regexp
11 * `$~` - the last regexp match, as an array of subexpressions
12 * `$n` - the nth subexpression in the last match (same as `$~[n]`)
13 * `$=` - case-insensitivity flag
14 * `$/` - input record separator
15 * `$\` - output record separator
16 * `$0` - the name of the ruby script file
17 * `$*` (or `ARGV`) - the command line arguments
18 * `$$` - interpreter's process ID
19 * `$?` - exit status of last executed child process
20 * `$-i` `$-l` `$-p` `$-v` - Command line switches
21 * `$-v` (or `$VERBOSE`) - verbose mode