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

Answer Posted / mass

Chop removes the last character of string completely and returns that last character. While chomp removes the last character if it is new line.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is q (single q) operator in perl?

526


Explain the use of 'my' keyword in perl?

556


What are different data types that perl supports. Elaborate on them.

544


What is the use of 'ne' operator?

487


What does last statement do in perl?

523






What is stdin in perl?

539


How do I replace every character in a file with a comma?

524


You want to read command-line arguements with perl. How would you do that?

495


How can information be put into hashes?

530


What's the difference between /^Foo/s and /^Foo/?

544


How do I do fill_in_the_blank for each file in a directory?

540


What is 'commit' command in perl?

603


For a situation in programming, how can you determine that Perl is a suitable?

480


What is a perl references?

517


How to concatenate strings in perl?

586