就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the help center为指导。
9年前关闭。
chomp 函数的目的和优点是什么。
它都能做什么?
使用 chomp 会产生任何问题吗?
或者在文件打开后使用 chomp 是必要的?
最佳答案
chomp 用于删除 $/
主要设置为 \n
的变量(新队)。
$/ is the input record separator, newline by default.
chomp: It returns the total number of characters removed from all its arguments. It's often used to remove the newline from the end of an input record.
关于perl - 什么时候使用 chomp?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12619545/