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

Re^4: FATAL ERROR: Can't use string ("HASH(0x875fffc)") as a HASH ref while "strict refs" in use at

by earlati2 (Beadle)
on Jun 18, 2008 at 06:17 UTC ( [id://692627]=note: print w/replies, xml ) Need Help??


in reply to Re^3: FATAL ERROR: Can't use string ("HASH(0x875fffc)") as a HASH ref while "strict refs" in use at
in thread FATAL ERROR: Can't use string ("HASH(0x875fffc)") as a HASH ref while "strict refs" in use at

You' re right.

I was wrong just because I think that Tie should manage also inner hash. Now it's all more clear and I fix my program so it now works as expected.

Thanks to everyone.

  • Comment on Re^4: FATAL ERROR: Can't use string ("HASH(0x875fffc)") as a HASH ref while "strict refs" in use at

Replies are listed 'Best First'.
Re^5: FATAL ERROR: Can't use string ("HASH(0x875fffc)") as a HASH ref while "strict refs" in use at
by Anonymous Monk on Jun 20, 2008 at 07:39 UTC
    sub ab { $hash = { abc => 'cde', }; return "$hash is the value"; } $str = ab(); with $str how can i access the has of abc and its value. Since, its hash ref in a string..

      Basically, you can't. The memory allocated to $hash is released as soon as ab returns because there is no reference to $hash anymore. If you need a reference to data, keep it as a reference. Don't convert it to a string.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (7)
As of 2024-04-23 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found