Well you can do a pretty decent job of functional programming in Perl. The main concepts are trying to avoid side effects, and using higher order functions (like map and grep) when appropriate. I'm not sure what you mean by 2D syntax, but I'll give it a stab using Haskell (since I've noticed you've mentioned it before). Every FP tutorial on the planet must use the factorial function to demonstrate the features of the language, this one is no exception. Here's the easy definition...
fac n = product [1..n]
Haskell syntax for defining functions is very lightweight. No "sub" keyword or curley braces necessary. The lone '=' sign is what gives away that this is a function definition. The above code creates a function called "fac" of one argument (called "n"). The product function takes a list and multiplies each element together. Brackets are used to create lists, and the ".." operator is somewhat similar to perl's. So the factorial is the product of the numbers from 1 to n. Here's a recursive version...
fac n = if n<1 then 1 else n * (fac (n-1))
"if" is a function in Haskell (like most things), very similar to the ternary ? operator in Perl. As for 2D syntax, maybe you're refering to pattern matching? (like multi-methods in Perl6)...
fac 0 = 1 fac n = n * fac (n-1)
This merely means that if you call fac with an argument of 0, the answer is one, anything else compute n*fac(n-1). Haskell also has pattern gaurds. The pipe ('|') symbol introduces a set of alternatives to check on each invocation of the "fac" function. If it finds one of the conditions evaluates to true, then it returns the value of that alternative ("otherwise" is equal to "true")...
fac n | n == 0 = 1 | otherwise = n * (fac (n-1))
In perl, it would look something like...
sub fac { $n = shift; if($n==0) { return 1; } else #otherwise { return $n*fac($n-1); } }

In reply to Re^10: World's shortest intro to function programming by Anonymous Monk
in thread Thread on Joel on software forum : "I hate Perl programmers." by techcode

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.