Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How do I read command-line arguments with Perl?

1018


Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?

986


What is the use of -w, -t and strict in Perl?

992


Is perl compiler or interpreter?

940


what is perl language?

930


What does last statement do in perl?

1016


Comment on data types and variables in perl.

927


Is there any way to add two arrays together?

972


How to access parameters passed to a subroutine in perl?

956


How do I sort a hash by the hash value?

929


What are the reasons that cookie server can’t handle multiple connections?

948


what are the strategies followed for multiple form interaction in cgi programs?

948


What are the advantages of c over Perl?

940


what is Polymorphism in Perl?

970


you are required to replace a char in a string and store the number of replacements. How would you do that?

924