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

What does init 5 and init 0 do?

960


Comment on array slicing and range operator

909


What is the use of 'ne' operator?

940


How to read multi lines from a file in perl?

876


How do I print the entire contents of an array with Perl?

911


How do you turn on the perl warnings?

864


How will you access an element of a perl array?

898


Explain join function in perl?

897


How do I sort a hash by the hash value?

875


How do you give functions private variables that retain their values between calls?

907


Define dynamic scoping.

835


What is perl dbi?

851


How to create a package?

902


What are perl strings?

847


Explain splicing of arrays?

871