I can't do what chromatic said because I do not have an $obj at the point. (Remember that the call to the Daemon constructor never returns.)
Sure you can. The closure has to bind to the lexical at compile time, but the object has to be valid at the point of the call, which is after the object creation. Add one line:
my $id; $id = Frontier::Daemon->new( ... );
... then use $id in the closure.
In reply to Re^3: Missing object reference in sub
by chromatic
in thread Missing object reference in sub
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |