Modules

  • A • B • C • D • E
  • F • G • H • I • L
  • M • N • O • P • S
  • T • U • X

Tools

sub

Perl 5 version 14.0 documentation
Recently read

sub

  • 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 perlsub and perlref for details about subroutines and references, and attributes and Attribute::Handlers for more information about attributes.