in reply to Using PIped-in and invocation arguments in same script

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.

Replies are listed 'Best First'.
Re^2: Using PIped-in and invocation arguments in same script
by justkar4u (Novice) on Apr 08, 2011 at 02:03 UTC
    Thank you Wind for your suggestion. I was actually wanting to display an error in case none of the three scenarios were used so used 4 conditions :) Now its working great.