| home | resources | search | news | join | members: 6963 |
$!
The exception information message.
$@
The backtrace of the last exception, which is the array of "filename:line" or "filename:line:in `methodname'" (Mnemonic: where exception occurred at.)
$&
The string matched by the last successful pattern match in
nil
(Mnemonic: like & in some editors.) This variable is read-only.
$`
The string preceding whatever was matched by the last successful
nil
pattern match failed. (Mnemonic: ` often precedes a quoted string.) This variable is read-only.
$'
The string following whatever was matched by the last successful
nil
pattern match failed. (Mnemonic: ' often follows a quoted string.)
$+
The last bracket matched by the last successful search pattern, or
nil
you don't know which of a set of alternative patterns matched. (Mnemonic: be positive and forward looking.)
$1, $2...
Contains the subpattern from the corresponding set of parentheses
nil
the last pattern match failed. (Mnemonic: like \digit.) These variables are all read-only.
$~
The information about the last match in the current scope. Setting
$&
$+
$1
$2
The nth subexpression can be retrieved by
$~[nth]
(Mnemonic: ~ is for match.) This variable is locally scoped.
$=
The flag for case insensitive,
nil
(Mnemonic: = is for comparison.)
$/
The input record separator, newline by default. Works like
nil
whole file will be read at once. (Mnemonic: / is used to delimit line boundaries when quoting poetry.)
$\
The output record separator for the
<a href="function.html#print">print</a>
<a href="IO.html#write">IO#write</a>
The default is
nil
/, but it's what you get "back" from Ruby.)
$,
The output field separator for the
<a href="function.html#print">print</a>
Also, it is the default separator for
<a href="Array.html#join">Array#join</a>
(Mnemonic: what is printed when there is a , in your print statement.)
$;
The default separator for
$.
The current input line number of the last file that
$<
The virtual concatenation file of the files given by command line
$<.file
(Mnemonic: $< is a shell input source.)
$>
The default output for
<a href="function.html#print">print</a>
<a href="function.html#printf">printf</a>
$stdout
(Mnemonic: $> is for shell output.)
$_
The last input line of string by
gets
readline
It is set to
nil
gets
readline
meet
EOF
This variable is locally scoped. (Mnemonic: partly same as Perl.)
$0
Contains the name of the file containing the Ruby script being
$0
modifies the argument area that the ps(1) program sees. This is more useful as a way of indicating the current program state than it is for hiding the program you're running. (Mnemonic: same as sh and ksh.)
$*
Command line arguments given for the
$$
The process number of the Ruby running this script. (Mnemonic: same
$?
The status of the last executed child process.
$:
The array contains the list of places to look for Ruby scripts and
<a href="function.html#load">load</a>
or
<a href="function.html#require">require</a>
initially consists of the arguments to any -I command line switches, followed by the default Ruby library, probabl "/usr/local/lib/ruby", followed by ".", to represent the current directory. (Mnemonic: colon is the separators for PATH environment variable.)
$"
The array contains the module names loaded by
<a href="function.html#require">require</a>
<a href="function.html#require">require</a>
modules twice. (Mnemonic: prevent files to be doubly quoted(loaded).)
$DEBUG
The status of the -d
$FILENAME
Same as
$<.filename
$LOAD_PATH
The alias to the
<a href="#colon">$:</a>
$stdin
The current standard input.
$stdout
The current standard output.
$stderr
The current standard error output.
$VERBOSE
The verbose flag, which is set by the The variables which names are in the form of
$-?
is the option character, are called option variables and contains the information about interpreter command line options.
Pre-defined global constants
This article brought to you by the
Hiveminds Magazine - Staff. Contact us if you want to post an article or announcement anonymously Thoughtbox - So what did you think? |
Drupal London Hotels
Wordpress Laptop Reviews
Silverlight Just Dial International Calls
Joomla! Excel Training Courses
PHP excel courses in london
Windows Data Recovery
|
NewsletterGet updates on Hiveminds services, articles and downloads by signing up for the newsletter. |
Editor's choiceSome of the better articles, stories and tutorials found at Hiveminds. |
Find moreFind more of Hiveminds articles, stories, tutorials and user comments by searching. |
Picked linksHand picked websites and articles from around the web that provide quality reading. |