perlfunc
gods
<P>
sub - declare a subroutine, possibly anonymously
<P>
<HR>
<P>
sub
<FONT SIZE=-1>BLOCK</FONT>
<P>
sub
<FONT SIZE=-1>NAME</FONT>
<P>
sub
<FONT SIZE=-1>NAME</FONT>
<FONT SIZE=-1>BLOCK</FONT>
<P>
<HR>
<P>
This is subroutine definition, not a real function <EM>per se</EM>. With just a
<FONT SIZE=-1>NAME</FONT> (and possibly prototypes), it's just a forward declaration. Without a
<FONT SIZE=-1>NAME,</FONT> it's an anonymous function declaration, and does actually return a value: the
<FONT SIZE=-1>CODE</FONT> ref of the closure you just created. See
[perlman:perlsub|the perlsub manpage] and
[perlman:perlref|the perlref manpage] for details.
<HR>