Thread Fork und Storable (4 answers)
Opened by mark05 at 2020-08-16 12:05

pq
 2020-08-16 16:20
#192487 #192487
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
2020-08-16T10:05:09 mark05
Code: (dl )
my %retrieve = eval %{ thaw $a }  

Das sieht falsch aus und hat auch nichts mit fork zu tun, denke ich.

entweder:
Code: (dl )
1
2
my $retrieve = eval { thaw $a };
my %retrieve = %$retrieve;

oder:
Code: (dl )
my %retrieve = %{ +eval { thaw $a } };

Erste Variante ist vermutlich besser, du möchtest vermutlich auch checken, ob das eval erfolgreich war.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread Fork und Storable