Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Eval/package question

by GrandFather (Saint)
on Jan 21, 2020 at 10:33 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11111670]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-25 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found