chop 截去最后一个字符,无论是什么字符chomp 截去末尾的分隔符(\n),行分隔符由$/决定 $a="ab\n\n\n"; #截去多个空行。 $/=""; chomp($a); 转载于:https://www.cnblogs.com/tjxwg/p/3308894.html