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
Does Perl have reference type?
Explain different types of perl operators.
Explain perl. When do you use perl for programming? What are the advantages of programming in perl?
In Perl, what is grep function used for?
What are the purpose of close(), getc() and read() functions?
What are numeric operators in perl?
When would `local $_' in a function ruin your day?
What is confess function in perl?
What are the functions that can be performed using cgi program?
What is the use of now constructor in perl?
Explain split function in perl?
Write a script to reverse a string without using perl's built in functions?
Give an example of using the -n and -p option.
How to read from a pipeline with Perl
what is CPAN?