What does * $ <mean in Ruby mean?
1 answer
$<is ARGF. From the ruby standard documentation:
ARGF is a stream intended for use in scripts that process files specified as command line arguments or passed through STDIN.
Good explanation here
* is a splat operator.
You assign aand nwhat's inside ARGF / STDIN at this point.
Example:
raducroitoru@dotix ~$ cat a.txt
a
b
c
raducroitoru@dotix ~$ cat a.rb
a, n = *$<
puts "a is: #{a}"
puts "n is: #{n}"
raducroitoru@dotix ~$ ruby a.rb a.txt
a is: a
n is: b
+4