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

Answer Posted / nagaraju kancherla

chop() removes the last character from a scalar value.

chomp() checks whether the last characters of a string or
list of strings match the input line separator defined by
the $/ system variable. If they do, chomp removes them.


Is This Answer Correct ?    25 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between the variables in which chomp function work ?

597


Explain '->' in perl?

497


Why Perl aliases are considered to be faster than references?

535


Explain what is perl language?

504


You want to print the contents of an entire array. How would you do that?

519






What is 'rollback' command in perl?

543


What are prefix dereferencer?

502


Can inheritance be used in perl? Explain with the help of an example.

502


What is -> symbol in perl?

564


Explain arrays in perl.

513


List all the features of perl programming?

505


Which functions in perl allows you to include a module file.

489


What is cpan in perl?

542


Can inheritance be used in perl?

542


What can be done for efficient parameter passing in perl?

471