use strict; use warnings; use Storable; package Parent; sub run {   my $pipe = shift;   # der zu sendende String   my $string  = 'Hello World!';      $string  = Storable::nfreeze(\$string);   my $length  = length($string);   # maximale Bytes die geschrieben werden sollen   my $maxbyt  = 8;   my $offset  = 0;   my $rest    = $length;   my $sdsz    = $length < $maxbyt ? $length : $maxbyt;   open my $fh, '>>', $pipe or die $!;   while (my $chunk = substr($string, $offset, $sdsz)) {      syswrite($fh, $chunk, $sdsz) == $sdsz or die;      $rest -= $maxbyt;      last unless $rest;      $offset += $maxbyt;      $sdsz = $rest if $rest < $maxbyt;   }     close $fh; } package Child; sub run {   my $pipe   = shift;   my $rdsz   = 8;   my $string = ();   open my $fh, '<', $pipe or die $!;   while (my $byt = read($fh, my $chunk, $rdsz)) {      die unless $byt == $rdsz;      $string .= $chunk;   }     close $fh;   $string = Storable::thaw($string);   print "\n<$$string>\n"; } package main; use POSIX qw/mkfifo/; my $pipe = int(rand(999999)); mkfifo($pipe, 0600) or die; if (fork) {   Parent::run($pipe); } else {   Child::run($pipe); unlink($pipe); }