Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Eval/package question

by shmem (Chancellor)
on Jan 21, 2020 at 14:26 UTC ( [id://11111682]=note: print w/replies, xml ) Need Help??


in reply to Eval/package question

What is wrong? Why does the eval somehow access my hash, but does not add the value? Is it something obvious and I'm just blind today?

It does access the hash and puts this slots value on the LHS, not the hash slot accessing expression. So yes, you're being blind :-)
Try

eval ("\$items{3}{Value} = 2;"); # also: eval ('$items{3}{Value} = 2;');

Had you checked $@ after the eval, you would have seen that it contains

syntax error at (eval 2) line 1, near "="

since the LHS of the assignment is empty.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-20 00:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found