For starters, please use <c>...</c> instead of <pre>...</pre>.
It looks like your object got stringified
$ perl -e'
> sub method {}
> my $o = bless({});
> $o->method(); # Ok
> $o = "$o";
> $o->method();
> '
Can't locate object method "method" via package "main=HASH(0x814ec28)"
+ (perhaps you forgot to load "main=HASH(0x814ec28)"?) at -e line 6.
Tracing back I see you read a string from a file and expect it to magically become a socket handle. That's not gonna happen.
In fact, the handle gets closed at the end of PortConn as the last reference to it ($rethandle) goes out of scope.
The idea is fundamentally flawed. A handle is a token that represents a resource the OS has handed your process. The token is useless to any other process. If you want to store something, you need to store the connection details so you can re-establish the connection.
|