R
Ronny
To process a file line by line, I use the following idiom:
filename=....
....
File.new(filename).each_line {|line| ..... }
How can I use this approach, when the "file" to be processed, is the
standard input of
my Ruby program?
(In case you know Perl: In Perl, I would set
$filename="-"
because the dash denotes the "special file" standard input in Perl, but
this does not
work in Ruby).
Ronald
filename=....
....
File.new(filename).each_line {|line| ..... }
How can I use this approach, when the "file" to be processed, is the
standard input of
my Ruby program?
(In case you know Perl: In Perl, I would set
$filename="-"
because the dash denotes the "special file" standard input in Perl, but
this does not
work in Ruby).
Ronald