in reply to Re^2: Missing object reference in sub
in thread Missing object reference in sub
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Missing object reference in sub
by almut (Canon) on Sep 26, 2007 at 21:10 UTC | |
by chromatic (Archbishop) on Sep 26, 2007 at 23:09 UTC | |
|
Re^4: Missing object reference in sub
by Lazarus (Novice) on Sep 28, 2007 at 13:55 UTC |