if (@ARGV or !-t STDIN and !eof()) { while (<>) { ...