Help for this page

Select Code to Download


  1. or download this
    chomp
      ...
    ...
      in slurp mode ("$/ = undef") or fixed-length record mode ($/
      is a reference to an integer or the like; see perlvar) chomp()
      won't remove anything.
    
  2. or download this
    perl -e '$/ = "" ; $a = qq(AA\n\n); $b = qq(BB\n\n); $res = chomp ($a,
    +$b); print qq(>$a< removed $res\n>$b< removed $res\n)'
    >AA< removed 4
    >BB< removed 4