I am a Java developer, and I have been given Ruby code to understand and later to work on.
I went through the Ruby tutorials on tutorialspoint.com but I can\'t figur
It's one of the magic variables.
$_ holds value of the last line read from standard input. $_[0] is, therefore, first symbol of that string.
See English.rb for more magic variables
# The last line read by Kernel.gets or
# Kernel.readline. Many string-related functions in the
# +Kernel+ module operate on $_ by default. The variable is
# local to the current scope. Thread local.
alias $LAST_READ_LINE $_