in reply to Nicest way of getting STDIN a beauty contest

I guess I was unclear... If you simply run the command without anything it should exit and not wait for input.

The example provided does this but it's not exactly pretty.

  • Comment on Re: Nicest way of getting STDIN a beauty contest

Replies are listed 'Best First'.
Re^2: Nicest way of getting STDIN a beauty contest
by jwkrahn (Abbot) on Oct 09, 2009 at 09:46 UTC
    die "oops" if !@ARGV && -t STDIN; my @hosts = <>;
      This works nicely, thanks a lot that saves the day from ugly code.
Re^2: Nicest way of getting STDIN a beauty contest
by Anonymous Monk on Oct 09, 2009 at 09:47 UTC
    perl -lne "warn -t STDIN" perl -lne "warn -t STDIN" < file echo | perl -lne "warn -t STDIN"