Question: chomp is used in perl?
Answer: The chomp() function in Perl is used to remove the last trailing newline from the input string. In the above code, it can be seen that input string containing a newline character (\n) which is removed by chomp() function.