Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

perlfunc:sub

by gods (Initiate)
on Aug 24, 1999 at 22:43 UTC ( [id://302]=perlfunc: print w/replies, xml ) Need Help??

sub

See the current Perl documentation for sub.

Here is our local, out-dated (pre-5.6) version:


sub - declare a subroutine, possibly anonymously



sub BLOCK

sub NAME

sub NAME BLOCK



This is subroutine definition, not a real function per se. With just a NAME (and possibly prototypes), 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 the perlsub manpage and the perlref manpage for details.


Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-12-07 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (49 votes). Check out past polls.