in reply to File to take @ARGS or "<" Redirect

If you're really asking how to detect if STDIN is a terminal (when @ARGV is empty), I think the following works:

my @node_numbers; if (@ARGV) { @node_numbers = @ARGV; } else { die(<<"EOF") if -t STDIN; ##################################### # # use args or < a text file # ##################################### EOF { local $/; @node_numbers = split(' ', <STDIN>); } } # Do rest of code after here using @node_numbers

Replies are listed 'Best First'.
Re^2: File to take @ARGS or "<" Redirect
by awohld (Hermit) on Apr 20, 2005 at 19:48 UTC
    Perfect! That's exactly what I needed!!!!!!

    Awesome you guys are always a great help!!!
      which one did the trick? Don't keep us in suspense. Sorry, didnt realize how that sounded when I wrote it.

      Ted