Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

perlfunc:sub

by gods
on Aug 24, 1999 at 22:43 UTC ( #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
Chatterbox?
[marto]: yes
[Discipulus]: thanks i definetively must learn such stuff.. i must come out with a killing product and after i'll just do Perl elctronic and music.. ;=)
marto has a similar idea on the 'to do' list
[Discipulus]: 65-35 joint venture marto? ;=)
[choroba]: Fibonacci at 34!

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2017-10-17 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (225 votes). Check out past polls.

    Notices?