S
Steve D
My code dynamically creates a scalar with a text string that is a
valid Perl code line.
How can I get Perl to execute the line contained in that scalar?
I could write it to a temp file and then "do <file>", but I want to
avoid that overhead. It does not seem eval and "do BLOCK" are the
answer.
Any good solutions?
Regards,
Steve D
Basic idea:
$x = "Send A message 13 ;" ;
# how can I execute $x to call (defined in a different module) the
subroutine:
# Send ($;@) {...}
Just putting
Send A message 13 ;
at the point of interest does run "Send", so visibility is not a
problem, at least at that point.
valid Perl code line.
How can I get Perl to execute the line contained in that scalar?
I could write it to a temp file and then "do <file>", but I want to
avoid that overhead. It does not seem eval and "do BLOCK" are the
answer.
Any good solutions?
Regards,
Steve D
Basic idea:
$x = "Send A message 13 ;" ;
# how can I execute $x to call (defined in a different module) the
subroutine:
# Send ($;@) {...}
Just putting
Send A message 13 ;
at the point of interest does run "Send", so visibility is not a
problem, at least at that point.