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
There are some duplicate entries in an array and you want to remove them. How would you do that?
What are scalar data and scalar variables?
what are prefix dereferencer and list them out?
Is there any way to add two arrays together?
How to close a file in perl?
What is 'rollback' command in perl?
You want to print the contents of an entire array. How would you do that?
what is the difference between java and cgi?
What is the difference between localtime() and gmtime() functions?
Explain the execution of a program in perl.
What is the usage of -i and 0s options?
Explain join function in perl?
In Perl we can show the warnings using some options in order to reduce or avoid the errors. What are that options?
what is the function of Return Value?
Elaborate on perl bite-wise operators.