ARGF

From RubySpec

Jump to: navigation, search

ARGF, and its synomymous $<, are used to read user input in a Perl-ish manner (which is, in turn, based on common behavior of UNIX tools): when parameters are on ARGV (i.e., when there are command-line arguments), they are all treated as file paths, and input is taken from them in the order they appear; when ARGV is empty, input is taken from STDIN.

Kernel.gets is a shortcut for ARGF.gets.

Personal tools