Thread Hash aus Datei an Skalar binden (8 answers)
Opened by Gast at 2007-11-22 11:33

bloonix
 2007-11-22 12:08
#102766 #102766
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use strict;
use warnings;
use Safe;
use Data::Dumper;

open my $fh, '<', 'hashref.txt' or die $!;
my $input = do { local $/; <$fh> };
close $fh;

my $sandbox = Safe->new;
my $hashref = $sandbox->reval($input);
die $@ if $@;

print Dumper($hashref);
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread Hash aus Datei an Skalar binden