if ($#ARGV == -1){..#no arguments passed.} elsif ($#ARGV == 1){..# arguments passed from command line.} elsif (-t STDIN and not @ARGV){..#piped inputs are supplied....do this} else {default: usage error}