At PerlWhirl '02 I sat in on one of Dominus' lectures on using functional programming techniques in Perl. I asked where I could learn more about this and was recommended the book Structure and Interpretation of Computer Programs.
The examples are in Scheme, which is line-noise to me, so I've been using the scm2perl translator to help me understand the examples in my native perl. It does a decent job of translation, although it doesn't understand lambda functions (anon subs). scm2perl is part of the Gimp CPAN package and handles Gimp's script-fu dialect of Scheme.
Example:
[localhost:~] thomas% less sum.scm
(define (sum term a next b)
(if (> a b)
0
(+ (term a)
(sum term (next a) next b))))
[localhost:~] thomas% scm2perl sum.scm
creating parser...done
header...reading(sum.scm)...translating...trailer...wrote(sum.pl)
[localhost:~] thomas% less sum.pl
#!/usr/bin/perl
use Gimp qw(:auto);
use Gimp::Fu;
sub sum {
my ($term, $a, $next, $b) = @_;
if ($a > $b) {
0;
} else {
(term ($a) + sum ($term, next ($a), $next, $b));
}
}
exit main;
I seriously suggest trying to wean yourself out of the translator. Grok Scheme. Then move on and grok Smalltalk. Prolog. Forth. (*) That's called "learning", I believe.
(*) No, that's not a progression of "guruness", or recommendations, just a selection of mind-expanding experiences.