From a0db0557a21b32bec8448aed9d672d7282a565ab Mon Sep 17 00:00:00 2001 From: Harvie Date: Fri, 11 Jun 2010 15:52:41 +0200 Subject: [PATCH] Example of handling functions as strings... --- perl/map-reduce/function-string.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 perl/map-reduce/function-string.pl diff --git a/perl/map-reduce/function-string.pl b/perl/map-reduce/function-string.pl new file mode 100755 index 0000000..d3a7d22 --- /dev/null +++ b/perl/map-reduce/function-string.pl @@ -0,0 +1,11 @@ +#!/usr/bin/env perl +use strict; +use warnings; + +my $sub = q {{ + print "rofl\n"; +}}; + +print "$sub\n"; +eval $sub; +eval "sub foo $sub"; foo(); -- 2.30.2