Re: CPAN Upload: JPRIT/Event-0.67.tar.gz
[email protected] (Joshua N Pritikin)
| Newsgroups | perl.loop |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Feb 10, 2000 at 10:53:55AM +0100, [email protected] wrote: > Another thing was fixed as well, so I can no longer say > > $groupWatcher->add(\$groupWatcher); > > in a script. But if I do this in the debugger, my Linux perl crashes > with a segmentation fault. That's strange. Can you post a stack trace? > The following should work, shouldn't it? > > $w1=Event->group(parked=>1); > $w2=Event->group(parked=>1); > $w1->add(\$w2); > > It is denied. Try: $w1->add($w2); # without taking a reference Should it require a reference to the watcher? > Preparing the talk, I noticed the following. > > This script: > > - snip -- > > use Event; > > $w=Event->io(fd=>\*STDIN, cb=>sub {<STDIN>; warn "CALLED!\n";}); > print "io default poll attribute:", $w->poll, "\n"; > > Event::loop; > > - snip -- > starts a loop which does nothing even if you enter something at STDIN > because there seems to be no default for the poll attribute. I think it > should be, or the watcher should not become active. I only checked this > for poll. Wow! That's an actual bug ... fixed. > - The doc says, and it is a good thing, that insufficient attribute > settings cause an implicit call of stop(). But > > Event->io; > > does not call stop(), it terminates the script by an exception. This > may be subject to discussion, I only mention it. I personally would > prefer a warning or (at the users choice (controlled by a class > variable?)) a silent implicit stop() call. That's a good idea. I wonder if Event can use lexical warnings? Does anyone know the answer to this? > - The prio() method replies the current priority. Additionally, if a > parameter is passed, it MODIFIES it. So, I would expect the following to > report AND modify, but it does not report if it modifies (3rd line): > > $w=Event->io(parked=>1); > print "Default: ", $w->prio, "\n"; > print "Changed: ", $w->prio(6), "\n"; > print "Checked: ", $w->prio, "\n"; > > Again, I did not check this for other attribute methods. All the attributes are the same. What do you want $w->prio(6) to return? The old priority or the new priority? Is it really worth the trouble of returning anything? -- "Never ascribe to malice that which can be explained by stupidity." via, but not speaking for Deutsche Bank