Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Using eval to create a hash

by BillKSmith (Monsignor)
on Jun 01, 2015 at 12:38 UTC ( [id://1128556]=note: print w/replies, xml ) Need Help??


in reply to Using eval to create a hash

Perhaps this is what you mean:
use strict; use warnings; use Data::Dumper; my $index = q{ 1 => 'foo', 2 => 'bar', 3 => 'baz', }; my %index3 = eval $index; print Dumper \%index3;
OUTPUT:
$VAR1 = { '1' => 'foo', '3' => 'baz', '2' => 'bar' };
Bill

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-24 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found