Re: 'Coro' segfaults on DO and EVAL
[email protected] (( Marc) (A.) (Lehmann )) Tue, 22 Feb 2005 20:44:06 +0100
| Newsgroups | perl.loop |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Feb 22, 2005 at 06:32:29PM +0100, Rachwal Waldemar-AWR001 <[email protected]> wrote: > However, the first trial script with Coro segfaults unexpectedly when I do > perl's 'do "SCRIPT"'. The problem is that Coro cannot reliably work when you jump in/out of currently-being-compiled code, as perl changes too much of global state when compiling programs, and doesn't tolerate context switches at that point. You should be able to compile code, and use cede in it, but it has to be done in seperate steps. (i.e. eval { } instead of eval ""). The workaround for 'do ""' would be to read the string, compile it into a sub, and run it. It might be possible to support just that case, as compiling is almost finished, and it might be possible to detetc this case and barf with a better error message. I will have a look at it. > Do I do something wrong? Not really, you are just running into a limitation that perl sets, and is not documented anyhwere :/ On a less serious level, yes, you do sth. wrong: > eval q| > |; Of course, recompiling the code makes no sense, but I guess it's just for the sake of the example. You _should_ be able to replace all occurrences of that by seperate 'my $sub = eval "sub { ... }"; &$sub' invocations. -- The choice of a -----==- _GNU_ ----==-- _ generation Marc Lehmann ---==---(_)__ __ ____ __ [email protected] --==---/ / _ \/ // /\ \/ / http://schmorp.de/ -=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE