Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Get out of a function earlyGet context of the current sub ... (Berikutnya)
Keywords related to control flow of your perl program

Declare a subroutine, possibly anonymously

Daftar Isi

  • 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 aBLOCK it's just a forward declaration. Without a NAME, it's an anonymousfunction declaration, so does return a value: the CODE ref of the closurejust created.

    See perlsub and perlref for details about subroutines andreferences; see attributes and Attribute::Handlers for moreinformation about attributes.

 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) Get out of a function earlyGet context of the current sub ... (Berikutnya)