Help for this page

Select Code to Download


  1. or download this
    print scalar split /\n/ for "1\n2\n3\n\n";  # Prints 3 instead of 4
    
  2. or download this
    print scalar split /\n/, $_, -1 for "1\n2\n3\n\n";  # Prints 5
    
  3. or download this
    print tr/\n// + !/\n\z/;