What is the difference between chop & chomp functions in perl?
Answer Posted / nagaraju kancherla
chop() removes the last character from a scalar value.
chomp() checks whether the last characters of a string or
list of strings match the input line separator defined by
the $/ system variable. If they do, chomp removes them.
| Is This Answer Correct ? | 25 Yes | 5 No |
Post New Answer View All Answers
How to close a file in perl?
What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?
What are prefix dereferencer?
What are the purpose of close(), getc() and read() functions?
How can the user execute a long command repeatedly without typing it again and again?
What is the syntax used in Perl grep function?
What is the use of strict?
“Perl regular expressions match the longest string possible”. What is the name of this match?
How can you use Perl warnings and what is the importance to use them?
Which operator in perl is used for the concatenation of two strings?
What is the importance of perl warnings?
What does cgi program store?
What is -> symbol in perl?
What is it meants by '$_'?
List all the features of perl programming?