Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How to turn "HASH(0x1234567)" into a real HASH

by ikegami (Patriarch)
on Oct 13, 2017 at 17:23 UTC ( [id://1201333]=note: print w/replies, xml ) Need Help??


in reply to How to turn "HASH(0x1234567)" into a real HASH

There's no telling if the hash still exists! If it doesn't, this could kill or corrupt your process. In other words, using this (or any other solution) is wrong!

use Carp qw( croak ); use Inline C => <<'__EOS__'; SV* _newRV(UV addr) { return newRV((SV*)addr); } __EOS__ sub destringify_ref { $_[0] =~ /\(([^()]*)\)/ or croak("Invalid input"); return _newRV(hex($1)); } my %hash = ( a => 2, b => 3 ); my $ref = \%hash; $ref = "$ref"; $ref = destringify_ref($ref);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1201333]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-29 01:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found