in reply to Storing the bytecode compiled with eval()

That depends on what you mean by 'compile once'. If you mean, once per invocation of the program, it's not too terribly difficult to do. Simply build a text string that can be read as valid Perl code containing an anonymous subroutine:
my $sub <<SUB; sub { print "I've been compiled once! I'm anonymous!\n"; } SUB my $sub_ref = eval $sub;
This is off the top of my head, so you may have to play around with it slightly.

If you're looking for a way to compile a string once and have that persist across invocations of the program, you'll have to look into something like B::Bytecode, which is experimental and may not gain you very much.

Other options include normal anonymous subroutines and closures. There's probably a way to get around most specific problems there, but knowing how to eval an anonymous subroutine into existence can occasionally come in handy.