ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 


 

Company >> DELL >> Interview Questions >> CGI Perl Interview Questions
 
  USA Dependent Visa H4 Visa Interview Questions (1)   Everything Else AllOther Interview Questions (1)   Teaching Interview Questions (1)
  General Knowledge_Current Affairs Interview Questions (1)   Call Centre AllOther Interview Questions (44)   Accounting AllOther Interview Questions (4)
  Human Resources Interview Questions (1)   Marketing Sales Interview Questions (1)   Engineering AllOther Interview Questions (1)
  SD Interview Questions (1)   ABAP Interview Questions (3)   VoIP IP Telephony Interview Questions (1)
  Project Management Interview Questions (1)   HR Questions Interview Questions (5)   SAS Interview Questions (1)
  Data Stage Interview Questions (1)   Cognos Interview Questions (1)   HTML DHTML Interview Questions (1)
  IBM MainFrame AllOther Interview Questions (1)   Servers AllOther Interview Questions (1)   Manual Testing Interview Questions (5)
  Load Runner Interview Questions (1)   Operating Systems General Concepts Interview Questions (1)   Linux Threads Interview Questions (1)
  SQL PLSQL Interview Questions (5)   SQL Server Interview Questions (1)   Dot Net Remoting Interview Questions (9)
  ADO.NET Interview Questions (2)   COM+ Interview Questions (3)   ASP.NET Interview Questions (14)
  Networking AllOther Interview Questions (1)   Networking Administration Interview Questions (1)   CGI Perl Interview Questions (1)
 
Back to Questions Page
Question   What is the difference between chop & chomp functions in perl? Rank Answer Posted By  
 Interview Question Submitted By :: Jkonakan
I also faced this Question!!   © ALL Interview .com
Answer
chop is used remove last character,chomp function removes
only line endings.
 
0 Thangaraju
 
 
Answer
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.
 
0 Wicked_sunny
[Wipro]
 
 
Answer
chop() removes the last character from a scalar value.

chomp() checks whether the last characters of a string or 
list of strings match the input line separator defined by 
the $/ system variable. If they do, chomp removes them.


 
0 Nagaraju Kancherla
[Wipro]
 
 
 
Answer
chop will indiscriminately remove (and return) the last 
character passed to it, while chomp will only remove the 
end of record marker (generally, "\n"), and return the 
number of characters so removed.
 
0 Devinder Kumar
[Wipro]
 
 
Answer
chop removes the last character and returns the character
chopped
Chomp removes any trailing string that corresponds to the
current value of $/ and returns number of characters removed
 
0 Ramya
[Wipro]
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com