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.


In reply to Re^4: Functional Perl 6/PUGS by tilly
in thread Functional Perl 6/PUGS by stvn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.