Example of handling functions as strings...
[mirrors/Programs.git] / 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 (executable)
index 0000000..d3a7d22
--- /dev/null
@@ -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();
This page took 0.093323 seconds and 4 git commands to generate.