in reply to eval that doesn't exec?

my $subref = eval "sub {\n" . $yourcode . "\n}";

I always put the newlines in there because I've had comments at the very end mess with the final brace. The first newline isn't particularly necessary, but it's a good visual cue.

Replies are listed 'Best First'.
•Re: Re: eval that doesn't exec?
by merlyn (Sage) on May 11, 2002 at 17:31 UTC