small issue with ->private method

[email protected] (( Marc) (A.) (Lehmann ))
Newsgroups perl.loop
Message-ID <[email protected]>
While writing Coro::Event I stumbled over a very small issue. I created
events using calls similar to these:

   $w = Event->io(private => $q, ...);

but never got anything back from the private method except undef. I can
now only make a quick guess that private, which uses the caller's package,
sees some other package (probably Event itself) when using it while
initalizing the watcher.

As such the fix was easy:

   $w = Event->io(...);
   $w->private($q);

If it's eay to fix I'd say fix it. If a fix would make private slower I'd
say document this and don't fix it ;)

-- 
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       [email protected]      |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.