I must not be explaining myself, or it's so basic people are overlooking the
obvious, thinking I want to do something more complicated.
Here is what I want to do.
I want to pass reference (my own) to one of the events. That way within the
event I have access to reference passed.
In non-poe code I'd do:
sub one {
my $data;
two(\$data);
}
sub two {
my $data = shift;
$$data = "I'm setting it here"
}
In POE I'd like accomplish the same but I don't know how to get put an extra
parameter in to the parameter list sent by an event. I tried this (but
obviously it doesn't work):
sub one {
my $data;
my $poe = POE::Component::Client::TCP->new(
...
## Notice the reference to $data in the line below
ServerInput => \&serverResponse(\$data)
);
reference to $data
);
}
sub serverResponse {
# HERE I'd like to get at the reference to $data
}