Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: unable to eval dumped hash

by nysus (Parson)
on Apr 28, 2020 at 00:44 UTC ( [id://11116144]=note: print w/replies, xml ) Need Help??


in reply to unable to eval dumped hash

OK, noodled with this some more. This worked:

use Data::Dumper qw(Dumper); use warnings; use strict; my $hash; { local $/; $hash = <DATA>; } my $VAR1; eval $hash; print keys %$VAR1; __DATA__ $VAR1 = { 'blah.com' => [ '212.235.56.176' ], 'blah.org' => [ '212.235.56.176' ], 'www.boo.org' => [ '212.235.56.176' ], };

Originally, I was using eval like I was running a block of code, but that's not what I wanted.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-20 02:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found