Computer Hope

Other Pages

Home
Site map
Computer help

Dictionary
News
Q&A
What's new

Tools

E-mail this page
Print Preview
Edit this page



 

Routine / Subroutine

A routine or subroutine also referred to as a function, procedure, and subprogram is a portion of code that may be called and executed anywhere in a program. For example, a routine may be used to save a file or display the time. Instead of writing the code for these commonly performed tasks, routines are made and called when these tasks need to be performed. Below is a basic example of a Perl subroutine.

&hello;

sub hello {
     print "Hello World!\n";
}

In the above example, a user could call the "hello" subroutine (in this example, by typing "&hello;") anywhere within the program and have the program print "Hello World!".

Also see: Call, DLL, Function, Programming definitions, Stubroutine

 

Index

Category:
Dictionary

Related Pages:
R - Definitions

Resolved

Were you able to locate the answer to your questions?

Home - Computer help - Contact - Dictionary - Links
Link to Computer Hope - Bookmark Computer Hope