HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/share/doc/libipc-shareable-perl/examples/get
#!/usr/bin/perl -w
#
# Test of shared arrays courtesy Terry Ewing <terry@intevo.com>
# 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);
}