From: Harvie Date: Fri, 11 Jun 2010 13:52:41 +0000 (+0200) Subject: Example of handling functions as strings... X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=a0db0557a21b32bec8448aed9d672d7282a565ab;p=mirrors%2FPrograms.git Example of handling functions as strings... --- 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();