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

FoxtrotUniform's scratchpad

by FoxtrotUniform (Prior)
on Jun 02, 2004 at 00:20 UTC ( [id://358884]=scratchpad: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @fn_refs = map {sub { print "$_\n"}} qw(foo bar baz);
    
    for (@fn_refs) {
        $_->();
    }
    
  2. or download this
    CODE(0x8105f9c)
    CODE(0x8105f9c)
    CODE(0x8105f9c)
    
  3. or download this
    my @fn_refs = map {my $x=$_; sub { print "$x\n"}} qw(foo bar baz);
    
    for (@fn_refs) {
        $_->();
    }
    
  4. or download this
    foo
    bar
    baz
    
  5. or download this
    sieve :: [Int] -> [Int] -> [Int]
    -- sieve [] xs
    ...
    --  of marking composite numbers, we remove them.
    sieve p []      = reverse p
    sieve p (x:xs)  = sieve (x:p) (filter (\t -> (rem t x /= 0)) xs)
    
  6. or download this
    factorial n
      | n == 0    = 1
      | otherwise = n * factorial (n-1)
    

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 contemplating the Monastery: (5)
As of 2024-04-20 02:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found