Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: recursive anonymous subroutines

by snoopy (Deacon)
on Apr 07, 2006 at 01:30 UTC ( #541775=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    };
    
    print "factorial of 7 is ".&$sub(7)."\n";
    
  2. or download this
    my @factorials = map {&{
        my $this_sub;
    ...
        }}($_)} (3,5,7,9);
    
    print "factorials: @factorials\n";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://541775]
help
Chatterbox?
[stevieb]: thanks choroba for making the world right again by mentioning something as simple as a missing backslash ;)

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-07-25 23:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (383 votes). Check out past polls.