roho has asked for the wisdom of the Perl Monks concerning the following question:
Here is the program which I named test.pl:
#!/usr/bin/perl use strict; use warnings; while( <> ) { print $_; }
Note: I'm running on Windows, hence the use of "echo" below to pipe data.
Test #1: echo a | test.pl (This works as expected)
Test #2: test.pl (This silently waits for input. I need to test for this condition and exit the program)
"It's not how hard you work, it's how much you get done."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to Test For Empty Piped Input
by parv (Parson) on Sep 02, 2024 at 04:57 UTC | |
|
Re: How to Test For Empty Piped Input
by roho (Bishop) on Sep 02, 2024 at 08:22 UTC | |
|
Re: How to Test For Empty Piped Input
by etj (Priest) on Sep 02, 2024 at 07:10 UTC | |
by hippo (Archbishop) on Sep 02, 2024 at 08:32 UTC |