- publishing free software manuals
Perl Language Reference Manual
by Larry Wall and others
Paperback (6"x9"), 724 pages
ISBN 9781906966027
RRP £29.95 ($39.95)

Sales of this book support The Perl Foundation! Get a printed copy>>>

sub NAME BLOCK

sub NAME (PROTO) BLOCK

sub NAME : ATTRS BLOCK

sub NAME (PROTO) : ATTRS BLOCK

This is subroutine definition, not a real function per se. Without a BLOCK it's just a forward declaration. Without a NAME, it's an anonymous function declaration, and does actually return a value: the CODE ref of the closure you just created.

See 8 and 15 for details about subroutines and references, and "Get/set subroutine or variable attributes" (attributes) in the Perl Library Reference Manual (Volume 1) and "Simpler definition of attribute handlers" (Attribute::Handlers) in the Perl Library Reference Manual (Volume 2) for more information about attributes.

ISBN 9781906966027Perl Language Reference ManualSee the print edition