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
In reply to Re: File to take @ARGS or "<" Redirect
by ikegami
in thread File to take @ARGS or "<" Redirect
by awohld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |