This isn't really obfuscation, it's even vaguely useful, but see if you can figure out what Pipes.pm must be doing, given that this prints o-l-l-e-H
use strict; use warnings; use Pipes; print "hello" | fn { ucfirst($_[0]) } | fn { [ split('', $_[0]) ] } | fn { [ reverse(@{$_[0]}) ] } | fn { join('-', @{$_[0]}) } | fn { $_[0] . "\n" };
perl -e 'print sub { "Hello @{[shift->()]}!\n" }->(sub{"World"})'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Functional Composition
by ikegami (Patriarch) on Dec 17, 2009 at 21:10 UTC | |
by billh (Pilgrim) on Dec 17, 2009 at 21:19 UTC | |
by ikegami (Patriarch) on Dec 17, 2009 at 21:22 UTC | |
by billh (Pilgrim) on Dec 17, 2009 at 22:02 UTC | |
by ikegami (Patriarch) on Dec 18, 2009 at 01:09 UTC | |
|
Re: Functional Composition
by BrowserUk (Patriarch) on Dec 17, 2009 at 21:04 UTC | |
by billh (Pilgrim) on Dec 17, 2009 at 21:38 UTC |