Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by LanX (Saint)
on Oct 13, 2017 at 16:49 UTC ( [id://1201329]=note: print w/replies, xml ) Need Help??


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

It's not possible, to turn the stringified hash address into a reference.

(At least not without meddling with internals and risking segfaults)

My advice, keep the original reference.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

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

Replies are listed 'Best First'.
Re^2: How to turn "HASH(0x1234567)" into a real HASH
by rodd (Scribe) on Oct 13, 2017 at 17:00 UTC
    Thanks, that did it!

    my $hash = bless(\(0+hex $addr), "B::AV")->object_2svref;
      You are aware about the risks?

      Strings have no ref count!

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-19 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found