#!/usr/bin/perl use strict; use warnings; use Fcntl qw(:DEFAULT :flock); use Data::Dumper; use 5.010; system('cls'); my %struktur = ( 'hash_im_hash' => { 'foo' => 'bar', 'foo2' => 'bar2', }, 'array_im_hash' => [ { 'foo4' => 'bar4', 'foo6' => 'bar6', }, { 'foo8' => 'bar8', 'foo10' => 'bar10', }, ], 'string_im_hash' => 'alfred', ); if (sysopen(my $dateifh,'test_io.txt',O_WRONLY|O_TRUNC|O_CREAT)) { if (binmode($dateifh)) { $Data::Dumper::Terse = 1; print $dateifh Dumper(\%struktur); if (close($dateifh)) { say "Fertig"; } else { die $!; } } else { die $!; } } else { die $!; } if (open(my $fh,'<','test_io.txt')) { my $test = eval do { local $/; <$fh>; }; if ($@) { die $@; } else { if (close($fh)) { say "\n\nGelesen:".Dumper($test); } } }