Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: unable to eval dumped hash

by nysus (Parson)
on Apr 28, 2020 at 00:44 UTC ( #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? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2022-05-22 15:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (80 votes). Check out past polls.

    Notices?