> On Tue, 7 Aug 2001 09:27:43 -0400, John Porter wrote:
>
> >David L. Nicol wrote:
> >> eval ${code}o;
> >
> >Another brilliant idea from David Nicol!
>
> Not really.
>
> What I would like is an option to just *compile* a piece of perl code,
> without executing it. This kinda works:
>
> $coderef = eval "sub { $code }";
>
> and currently (5.6.0) even if $code contains sub definitions; but it's
> still just a hack.
How about having an EVAL object-type ? (somewhat analogous to the
relationship between INT and int)
my $compiled=new EVAL($code);
$compiled.execute;
The constructor just compiles and the execute method just executes.
-- Marc --