start page | rating of books | rating of authors | reviews | copyrights

Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: Reference: study Chapter 5
Function Reference
Next: Reference: substr
 

sub

sub 
name
 [
proto
] {
block
} sub [
proto
] 
name

Declares and defines a subroutine. name is the name given to the subroutine; block is the code to be executed when the subroutine is called. Without block , this statement only declares a subroutine, which must be defined at some later point in your program. proto is a sequence of symbols that places constraints on the arguments that the subroutine will receive. See Section 4.7, "Subroutines" in Chapter 4 .


Previous: Reference: study Perl in a Nutshell Next: Reference: substr
Reference: study Book Index Reference: substr

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.