Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
Perl
Subroutine 107 codes
Home
Perl
Subroutine
1 A closure is an anonymous subroutine
2 A nested subroutine
3 A recursive subroutine to perform arithmetic
4 A subroutine is defined by the sub keyword and the block of code that follows
5 A subroutine that returns a scalar or a list
6 A subroutine that returns a value
7 Accessing variables in subroutines
8 Adding two arrays in a subroutine
9 Ading two arrays together
10 Anonymous functions
11 Anonymous Subroutines
12 BEGIN and END Subroutines (Startup and Finish)
13 Calculate 1000th element of standard Fibonacci sequence
14 Call a subroutine and use it
15 Call a subroutine through its reference
16 Call a subroutine without defining it
17 Call sub
18 Call subroutine with parameter by using its reference
19 Call the subroutine with $number
20 Calling a sub routine with
21 Calling a sub routine with subroutine_name()
22 Calling function in print statement
23 Calling subroutines that are not defined before use
24 Check the prototype
25 Closure in action
26 Context and Subroutines
27 Create a subroutine
28 Declaration with prototype
29 Define local variable in subroutine by using my
30 Define subroutine and call it with using global variable
31 Define subroutine prototype
32 Define subroutine then use it
33 Difference between my and local
34 Displays all the arguments
35 Duplicate global and local variable name (use strict;)
36 Factorial with recursive function
37 Is a parameter defined
38 Local variable shadows the gloabl variable
39 Local variable shadows the global variable in a subroutine
40 Local variables in subroutines
41 My ($program, $exitCode) = @_; creates two local variables, $program and $exitCode, from @_
42 My value scope
43 My variable
44 My variable is initialized each time
45 My, local and global variable
46 Nested method
47 Nested subroutine
48 Nested subroutine with local variable
49 Output the subroutine arguments using special variable @_
50 Pass file handle global reference to a subroutine
51 Pass reference to a subroutine to another subroutine
52 Pass two array reference to a subroutine
53 Passing a range of value to a subroutine
54 Passing an array and modifying it,as a reference
55 Passing array to a subroutine
56 Passing Arrays
57 Passing arrays to a function
58 Passing by reference with pointers
59 Passing different number of parameter to a subroutine
60 Passing hash to a subroutine
61 Passing parameters to subroutines
62 Passing References to a Subroutine
63 Passing two values to a subroutine
64 Prototypes
65 Recursive factorial subroutine
66 Recursive fibonacci function
67 Recursive subroutine
68 References to subroutines
69 Return a reference from a sub
70 Return a subroutine from a subroutine
71 Return hash value from subroutine
72 Return more than one value from subroutine
73 Return reference from a function
74 Return reference to variable
75 Return two array references from a subroutine
76 Return two arrays from subroutine
77 Return Value
78 Return value based on context
79 Return value from subroutine reference
80 Return value from subroutine without using the return statement
81 Returning arrays from subroutines
82 Returning data from subroutines
83 Scalar and list Context
84 Shift parameter
85 Subroutine parameter default value
86 Subroutine with arguments defined before it is used
87 Subroutine with no arguments defined after it is used
88 Subroutine with no arguments defined before it is used
89 Swap array value by using the sub range
90 The last statement is the value to return
91 The loop displays each individual argument
92 The return values of the ref function
93 The scope of my variables
94 The wantarray Function and User-Defined Subroutines
95 Use my to declare local variable
96 Using - operator to call a subroutine by its reference
97 Using closures
98 Using local
99 Using my
100 Using my if statement
101 Using my to declare the local variable in a subroutine
102 Using return statement
103 Using shift(@_) to get value passed into a subroutine
104 Using the return statement
105 Wantarray function
106 Wantarray() returns true if caller wants list, false if caller wants scalar, and an undefined value if the caller wants nothing
107 Write recursive subroutines