$! | latest error message | $@ | location of error | $_ | string last read by gets | $. | line number last read by interpreter | $& | string last matched by regexp | $~ | the last regexp match, as an array of subexpressions | $ n | the nth subexpression in the last match (same as $~[ n] ) | $= | case-insensitivity flag | $/ | input record separator | $\ | output record separator | $0 | the name of the ruby script file | $* | the command line arguments | $$ | interpreter's process ID | $? | exit status of last executed child process |
|
Finora conoscevo solo sette di queste variabili (per assonanza con Perl e con la shell: anzi, pensavo che Perl e la bash le avessero copiate da Ruby). Non si finisce mai di imparare...
Nessun commento:
Posta un commento