
Henning Koch
Deleted
Jun 19, 2000, 11:58 PM
Post #1 of 3
(302 views)
|
|
Making a sub of Perl code in a string
|
Can't Post
|
|
Code's more than a thousand words: $code = "print 'hi world';"; $mysub = sub { $code } $code = ''; &{$mysub}; Of course calling &{$mysub} would not print out "hi world" on my screen, because the code inside the sub is simply "$code", not "print 'hi world';". So how can I expand $code into Perl code? thanks, Henning PerlBall - Perl source compressor
|