I've got a script that grabs standard input:
(code snippet)
&process_input
sub process_input {
while(<STDIN>) {
$log_data .= $_;
}
}
When I run the script:
myscript.pl -param1=a -param2=b
I get stuck in this subroutine. Everything runs ok if I do:
echo "" | myscript.pl -param1=a -param2=b
Question is how do I determine if I even have a standard in put? I would have thought that while() would return false and not run, but I'm guessing it's actually waiting for you to type something in that why it's 'stuck'.
Thanks for the help :)