What is the difference between chop & chomp functions in perl?
Answer Posted / wicked_sunny
Chop and Chomp are two very similar functions. Both of them
are used to delete symbols from the tail of the given
string. While both work with string and list parameters,
Chop deletes any ending symbol Chomp deletes only specified
substring from the end. If you pass list to any of these
two, all list elements will get processed and the return
value would be the result of last operation.
| Is This Answer Correct ? | 22 Yes | 20 No |
Post New Answer View All Answers
How many loop control keywords are there in perl?
How to copy a file in perl?
Explain different types of perl operators.
What is perl pop array function?
What happens in dereferencing?
How to sort arrays in perl?
what is the difference between java and cgi?
How to concatenate strings with perl?
How to print escaping characters inside a string in perl?
What is the use of now constructor in perl?
What does delete function do in perl?
How many types of primary data structures in Perl and what do they mean?
How to implement a stack in Perl?
What does `new $cur->{LINK}' do? (Assume the current package has no new() function of its own.)
How can the user execute a long command repeatedly without typing it again and again?