OK. I think I understand now. Your problem is that
somewhere along the line you have "stringified" your
object and turned the reference into a string. There's no
way (that I know of) to undo this, so you'll need to find
out where the stringification takes place and fix that
piece of code. You're looking for somewhere where the
reference is quoted unnecessarily.
--
<http://www.dave.org.uk>
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
| [reply] |
I suspect that you could find the pointer again using
unpack with the -P option to follow a pointer back to
where the object is (hopefully) still in existence.
It would take a serious hacker to successfully do this,
and only the insane would consider it. I say this with
full knowledge that this may motivate you to demonstrate
what a wizard you are by going out and doing it. What
is worse is that I feel no remorse in saying this, I
am confident that you of all people are capable of
doing it, and I am sure you would find it fun in a crazy
sort of way.
Aren't I a jerk when I want to be? :-P
| [reply] |
But finding the pointer wouldn't be of much use unless you
(brace yourself) create a dummy object and then overwrite
its pointer with your newly re-found pointer. When you are
done, you overwrite the pointer with the original value
again.
The biggest problem with this is that your new object
reference didn't increment the reference count so the
object could be destroyed out from under you at any time
(if it wasn't already destroyed before you started).
For some tips on getting started on this, see (tye)Re: Creative use of pack/unpack.
-
tye
(but my friends call me "Tye")
| [reply] |
Would I be correct in guessing that your stringified reference comes out of a hash key? If so, you may want to have a look at Tie::RefHash. Otherwise, just create a hash table mapping pointer strings back to their original objects, as tye suggests.
If, however, by resurrecting, you mean reclaiming an object that was deleted by garbage collection (ie. refcount went to 0), this would be a very dangerous and unwise thing do, for reasons that are fairly obvious.
MeowChow
s aamecha.s a..a\u$&owag.print | [reply] |