What is the difference between chop & chomp functions in perl?
Answer Posted / shaheed
If there is new line character at the end of string, chop()
and chomp() both will remove that new line character.
Else if there is no new line character at the end of string
then chop() will remove last character from the string
while chomp() keeps the string unchanged.
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
How to deleting an existing file in perl programming?
What is the use of –w?
How to read from a pipeline with Perl
What is the difference between perl list and perl array?
What are the steps involved when the cgi program starts running?
Define operators used in perl?
What are some common methods to all handles in perl?
Explain the functioning of conditional structures in perl.
When does circular reference occur?
How can you call a subroutine and identify a subroutine?
For a situation in programming, how can you determine that Perl is a suitable?
How to know whether a key exists or not in perl?
How do you set environment variables in perl?
What is the use of -t?
You want to print the contents of an entire array. How would you do that?