What is the difference between chop & chomp functions in perl?
Answer Posted / wicked_sunny
Chop and Chomp are two very similar functions. Both of them
are used to delete symbols from the tail of the given
string. While both work with string and list parameters,
Chop deletes any ending symbol Chomp deletes only specified
substring from the end. If you pass list to any of these
two, all list elements will get processed and the return
value would be the result of last operation.
| Is This Answer Correct ? | 22 Yes | 20 No |
Post New Answer View All Answers
What does a die() function do in perl?
What rules must be followed by modules in perl.
What's the difference between /^Foo/s and /^Foo/?
What is the use of –w?
how to extract pin_code,phone_number,year from text file using regular expressions in perl
What are prefix dereferencer?
what are the two ways to get private values inside a subroutine or block?
how to connect cisco switch uisng perl script
Explain gmtime() function in perl?
Explain USE and REQUIREMENT statements?
Explain a tell function in perl?
you are required to replace a char in a string and store the number of replacements. How would you do that?
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 does the q{ } operator do?
How to concatenate strings with perl?