Help for this page

Select Code to Download


  1. or download this
    while ( <> ) {
        chomp;
        print "$_\n" if length $_;
    }
    
  2. or download this
    {
    local $/;
    ...
    $contents =~ tr/\n/\n/s;
    print $contents;
    }
    
  3. or download this
    $/='';chomp,print"$_\n"while<>
    
  4. or download this
    print/./?$_:''while<>
    
  5. or download this
    print/./?$_:''for<>
    
  6. or download this
    perl -ne "print if/./"
    
  7. or download this
    perl -0pe "y/\n/\n/s"
    
  8. or download this
    perl -ne "/./&&print"