>>298
% cat hoge.rb
$stdin = File.open("/path/to/file")
puts gets.chomp
% ruby hoge.rb hoge.rb
$stdin = File.open("/path/to/file")