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
What is the syntax used in Perl grep function?
What value is returned by a lone `return;’ statement?
“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?
Define print() function in perl?
How many types of operators are used in the Perl?
What is 'commit' command in perl?
Explain the difference between declarations of 'my' and 'local' variable scope in perl?
Explain the various characteristics of perl.
How to read multi lines from a file in perl?
What are the advantages of programming in perl?
Which operator in perl is used for the concatenation of two strings?
What is the difference between use and require in perl programming?
What are the options that can be used to avoid logic errors in perl?
Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.
What is the difference between perl list and perl array?