#!/usr/bin/perl -w # # Test of shared arrays courtesy Terry Ewing # See also eg/put use lib "."; use IPC::Shareable; use strict; my @shared; my $ipch = tie @shared, 'IPC::Shareable', "foco", { create => 1, exclusive => 'no', mode => 0666, size => 1024*512 }; while (1) { $ipch->shlock; my $line = shift(@shared); $ipch->shunlock; if ($line) { print $line."\n"; } # sleep(2); }