Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Specializing Functions with Currying

by FoxtrotUniform (Prior)
on Aug 06, 2004 at 00:42 UTC ( #380421=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    my @test_data = (
        ['none', 'The quick brown '],
        ['bold', 'dog'], 
        ['none', '.']
  2. or download this
    my %handlers = (
        'none' => sub {shift},
        return $handlers{'para'}->($text);
  3. or download this
    sub wrap_with_html
        'ital' => \&wrap_with_html('i',
        'para' => \&wrap_with_html('p',
  4. or download this
    sub curry
    my $plus_five = &curry(\&foo, 5);
  5. or download this
    sub curry
    print &build_para(\@test_data);

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://380421]
Approved by elusion
Front-paged by broquaint
[Tanktalus]: Tux: last hour of cb and the cbstats run on Coro/AnyEvent, so I'm kinda still using his stuff :)
[Tanktalus]: It's too bad, AnyEvent is really nice, and Coro is mindblowing. :(
[Tux]: JSON::XS is also something I wouldn't want to work without, so I use distroprefs and patches that I maintain on github

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (15)
As of 2017-09-20 16:20 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (237 votes). Check out past polls.