CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES PERL DETAILS
Question :
What is a subroutine?


Category Perl Interview Questions
Rating (5.0) By 23 users
Added on 7/19/2006
Views 1039
Rate it!
Answers:

A subroutine is like a function ... called upon to excecute a task.



When we are defining a function we have to use sub keyword in front of function name.<br><br>syntax:<br> sub functionname<br> {<br> statement;<br> }<br>Example:<br> if($a>0)<br> {<br> &fun();<br> }<br> sub fun<br> {<br> print "hai";<br> }



 Posted by: Gansi    

Contact Gansi  Contact Gansi

Subroutine is perl is a block of code specially combined/grouped to perform a particular task.Which can e called at any point of time in a perl program.<br><br>Advantage using Subroutine<br> a) helps in modular programming making it easier to understand and maintain<br> b)eliminates duplication by reusing the same code/calling the subroutine.



 Posted by: Shubhadip Deb    

Contact Shubhadip Deb  Contact Shubhadip Deb


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
What does 'qw(..)' mean? What's the use of it?
when do we use it?

View Answer
What does this symbol mean '->'

View Answer
What is meant by a 'pack' in perl?

View Answer
What is meant by 'chomp'? where do we require this ?

View Answer
what does this mean '$^0'? tell briefly plse..

View Answer
what's is the use of 'require' and what does this mean?

View Answer
what is meant 'die' in a perl program?

View Answer
what is a DataHash(). What does it mean? and for what purpose it is used??

View Answer
What is CPAN ? What are the modules coming under this?




View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL Perl Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/6188/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.91