I'd like to use stdin for input, but only if there is some data on it. If there is no data, I would like the script to continue and not wait for it.
I have figured out how to get these following methods of invoking the script to read data by adding various methods to the script,
./foo.pl bar01.data
./foo.pl bar01.data bar02.data
./foo.pl < bar01.data
./foo.pl < <(cat bar01.data)
cat bar01.data | ./foo.pl
What module or method should I look at to add to the above so that the following does not wait for input but merely continues without any data?
./foo.pl
I hope it is not too complex.