Help for this page

Select Code to Download


  1. or download this
    $input = <STDIN> if defined fileno(STDIN);
    
  2. or download this
    ken@titan ~/tmp
    $ perl -E 'my $input = "none"; $input = <STDIN> if defined fileno(STDI
    +N); say $input'
    ...
    none
    
    ken@titan ~/tmp
    
  3. 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>
    
  4. 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>
    
  5. 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