in reply to Creating subroutines on the fly
However, i don't know if it can be done without eval-ing it into $b. Hope this help you.#! /usr/bin/perl -w my $a = 'sub { $name = shift; return substr($name, 0, 1); }'; my $b = eval $a ; print &$b("wiredrat");
2005-02-16 Janitored by Arunbear - added code tags, as per Monastery guidelines
|
|---|