use Sys::Mmap; open MMM, '+<', '/tmp/mmap' or die $!; mmap $str, 0, PROT_WRITE|PROT_READ, MAP_SHARED, MMM; print $str, "\n"; # Here I get "Hello" from file /tmp/mmap # Here I should write "Goodbye" to mmap file. How do it? print $str, "\n"; # Here I must get "Goodbye" munmap($str); exit;