Help for this page

Select Code to Download


  1. or download this
    while (<STDIN>) {
       print;
    }
    
  2. or download this
    for (1..2) {
       while (<STDIN>) {
          print;
       }
    }
    
  3. or download this
    local $/;
    for (1..2) {
    ...
          print;
       }
    }
    
  4. or download this
    local $/;
    
    ...
    print;
    
    $_ = <STDIN>;  # Returns EOF
    
  5. or download this
    local $/;
    ($_) = <STDIN>;  # Returns first chunk
    ($_) = <STDIN>;  # Returns second chunk