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 connect to SQL server through Perl?
Write a program that shows the distinction between child and parent process?
What does Perl do if you try to exploit the execve(2) race involving setuid scripts?
How to disable the mod_perl from apache_server as i have used perlfect search on the site and its pagination is not working and the remedy is to disable the mod_perl.
Why is it hard to call this function: sub y { "because" } ?
What are perl strings?
What are stdin, stdout and stderr?
How does polymorphism work in perl? Give an example.
I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur
What's the difference between /^Foo/s and /^Foo/?
There is no strict data types in perl unlike in other high level languages like Java so wouldn't that be a problem if a code in perl is to be a written by a big team of 20+ members ?"
What is warn function in perl?
How many ways can we express string in Perl?
Explain goto expr?
What syntax is used for grep() function?