What is the difference between chop & chomp functions in perl?

Answer Posted / deepesh

chop() is used to remove last character where chomp() is
only remove new line if its existing or white space.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain gmtime() function in perl?

559


what is Chop & Chomp function does?

586


How will you get the count of parameters passed to a perl subroutine?

529


what is Perl one liner?

526


How does a “grep” function perform?

586






How many types of variable in perl?

545


what are the three groups involved in information sharing?

467


Explain tk?

511


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

558


What is the purpose of _package_ literal?

525


Explain goto name?

507


There are two types of eval statements i.e. Eval expr and eval block. Explain them.

475


What are some of the key features of objects in perl?

510


What is chomp() operator/function?

556


Explain perl one-liner?

506