This works quite nicely - just wondered if there are any improvements to shorten it ?
if (ARGV[0].nil?) then input=$< else input=File.new(ARGV[0],
then and ; are optional
then
;
also you can use the ternary operator:
input = ARGV[0].nil? ? $< : File.new(ARGV[0],"r")