Help for this page
$code = "print 'Hello World.'"; # This may have come for your DB $sub = eval "sub { $code }"; # use eval and string interpolation to co +nvert it into an anon. sub ... # You can capture the return value too $ret = $sub->();