Help for this page
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.
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