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

Where the command line arguments are stored and if you want to read command-line arguments with Perl, how would you do that?

1086


Explain ivalue?

991


What are different data types that perl supports. Elaborate on them.

1071


explain the various functions/directives in perl that allow you to include/import a module. Also, state the differences between them.

864


How interpreter is used in perl?

942


What is goto statement in perl?

930


What is the importance of perl warnings?

1136


How to prevent file truncation in perl?

1011


Why to use perl?

944


what is the function of Return Value?

1061


What does this symbol mean '->'?

1000


What is eval function in perl?

950


What is 'rollback' command in perl?

949


Which has highest precedence in between list and terms? Explain?

863


How can we create perl programs in unix, windows nt, macintosh and os/2 ?

887