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

Any sugestions ?

Look into truth tables, and test -t STDIN first

$ perl -le " warn 0 + @ARGV; warn 0 + -t STDIN" 0 at -e line 1. 1 at -e line 1. $ perl -le " warn 0 + @ARGV; warn 0 + -t STDIN" a b c d e f 6 at -e line 1. 1 at -e line 1. $ perl -le " warn 0 + @ARGV; warn 0 + -t STDIN" a b c d < NUL 4 at -e line 1. 0 at -e line 1. $ perl -le " warn 0 + @ARGV; warn 0 + -t STDIN" < NUL 0 at -e line 1. 0 at -e line 1.

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:04 UTC
    Thank you Anonymous monk for your suggestion. Learned something new !