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


Please Help Members By Posting Answers For Below Questions

What is 'commit' command in perl?

610


What is the closure in PERL?

571


What is qq (double q)operator in perl?

557


How are parameters passed to subroutines in perl?

507


What is automatic error handling in perl?

504






Explain substr function in perl?

538


What does cgi program store?

541


Explain goto expr?

496


Mention the difference between die and exit in Perl?

659


Distinguish my and local?

520


What value is returned by a lone `return;’ statement?

568


What is the syntax used in Perl grep function?

591


What are some common methods to all handles in perl?

506


How can you create anonymous subroutines?

547


Why to use perl scripting?

526