What is the difference between chop & chomp functions in perl?
Answer Posted / pallavi
Chop function removes the last character of any specified
string or variable and returns the chopped data.
Ex: $a="abcdefghijkla";
$b= chop($a);
print $a;
Output - abcdefghijkl
Where as chomp removes all the new line at the end of any
specified string or variable and returns nothing.
Is This Answer Correct ? | 15 Yes | 3 No |
Post New Answer View All Answers
What is the use of "stderr()"?
Write a cgi program to show the header part?
What is the difference between perl list and perl array?
Why Perl aliases are considered to be faster than references?
What are the various file operations in perl. Explain with example.
What are stdin, stdout and stderr?
Explain lexical variables.
How will you declare a variable in perl?
Write syntax to use grep function?
What is the easiest way to download the contents of a URL with Perl?
Explain about the applications of perl?
There are two types of eval statements i.e. Eval expr and eval block. Explain them.
How to determine strings length in perl?
what is the function of Return Value?
What are the steps involved in configuring a server using cgi programming?