First, there is no way to effectively pass compiled code between
processes at this time. It isn't likely to happen with Perl 5 because
attempts at loading compiled bytecode from disk have usually had poor
performance and other issues.
Second, what you're proposing is probably not a good idea
]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 29, 2002 11:16 PM
Subject: Re: Persistant references [was] Persistent Net::Telnet Objects
You could just pass around a string rather than a subref:
my $handler = 'sub { my $arg = @_; do_something(); }';
vs
my $handler = sub { my $arg
I never do give enough info on the first e-mail. Thank you for bearing with
me...
What I mean is, if a request comes in for a certain form I would like to be
able to do something like this:
my $form = load_form($r);
$c{$session_id}-{handler} = $form-{handler}; # -- this being a code
ref...
You could just pass around a string rather than a subref:
my $handler = 'sub { my $arg = @_; do_something(); }';
vs
my $handler = sub { my $arg = @_; do_something(); };
When you want to call it later on you do it like:
eval($handler)-('foo');
vs
$handler-('foo');
Garth
On