in reply to Re^3: Functional Perl 6/PUGS
in thread Functional Perl 6/PUGS

I'd suggest not worrying too much about what is "real functional programming". Instead try to pick up a couple of specific functional techniques that you find useful, get comfortable with them, and see where that leads. Even if it isn't "really" functional, if it is useful and not something you would have tried earlier, that's good enough.

My motto is, "objects make good nouns, functions make good verbs". A common situation is to do something like this:

$handler{$case}->(@arguments);
where %handler is a hash mapping specific cases to anonymous functions saying what to do for each case. (Some of those anonymous functions may be very similar to each other, and you factor those out into closures...) Look for opportunities to use that, and try it a few times. See how it looks. See whether the construct stands up under normal maintainance.

After a period of becoming comfortable with that, then you can try another technique. Such as setting up a mess of related functions to fill out a template. (I find myself doing that more often in JavaScript than Perl. I write a function that takes a group of related form elements and gives them closely related event handlers.)

Once it is comfortable, it will probably become useful. And vice versa.