Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Storing the bytecode compiled with eval()

by ZZamboni (Curate)
on Apr 30, 2001 at 19:47 UTC ( [id://76631]=note: print w/replies, xml ) Need Help??


in reply to Storing the bytecode compiled with eval()

You could define it as an anonymous subroutine and store it in a code ref:
$subref=eval 'sub { your code here }' die $@ if $@; ...
And then call it any time you want as:
$subref->();
or define it like a normal subroutine:
eval 'sub mysub { your code here }'; die $@ if $@;
And then call it with:
mysub();

--ZZamboni

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://76631]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-26 04:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found