Change the order of your tests. Note that No Arguments and default are the same thing:
if (@ARGV){ print "Command line args\n"; } elsif (! -t STDIN) { print "STDIN\n"; } else { print "Default\n"; }
I don't believe your -t STDIN test will work though. Don't know what the right test is for that at the moment.
Update: Fixed STDIN test per Anon Monk's post.
In reply to Re: Using PIped-in and invocation arguments in same script
by wind
in thread Using PIped-in and invocation arguments in same script
by justkar4u
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |