- or download this
$input = <STDIN> if defined fileno(STDIN);
- or download this
ken@titan ~/tmp
$ perl -E 'my $input = "none"; $input = <STDIN> if defined fileno(STDI
+N); say $input'
...
none
ken@titan ~/tmp
- or download this
C:\Users\ken\tmp>perl -E "my $input = 'none'; $input = <STDIN> if def
+ined fileno(STDIN); say $input"
qwerty
...
none
C:\Users\ken\tmp>
- or download this
PS C:\Users\ken\tmp> perl -E 'my $input = "none"; close STDIN; eval {
+defined fileno(STDIN) } and do { $input = <STDIN> }; say $input'
none
...
PS C:\Users\ken\tmp> perl -E 'my $input = "none"; close STDIN; $input
+= <STDIN> if defined fileno(STDIN); say $input'
none
PS C:\Users\ken\tmp>
- or download this
This is perl 5, version 30, subversion 0 (v5.30.0) built for cygwin-th
+read-multi
This is perl 5, version 30, subversion 0 (v5.30.0) built for MSWin32-x
+64-multi-thread