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

Re: Eval/package question

by GrandFather (Sage)
on Jan 21, 2020 at 10:33 UTC ( #11111670=note: print w/replies, xml ) Need Help??


in reply to Eval/package question

We can simplify the test case to:

use strict; use warnings; my %items; eval ("$items{3}{Value} = 2;");

The issue is that $items{3}{Value} is evaluated as the string is being constructed. A simple fix it to use single quotes so interpolation doesn't happen. A better fix is not to use string eval!

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2020-10-26 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (251 votes). Check out past polls.

    Notices?