in reply to Re: Re: Re: Re: Global variables over many children
in thread Global variables over many children

MLDBM::Sync can share arrays. What's the problem?
  • Comment on Re: Re: Re: Re: Re: Global variables over many children

Replies are listed 'Best First'.
RE: Global variables over many children
by Anonymous Monk on Dec 06, 2001 at 11:55 UTC
    Oh right. Can you give me a hint how it does that, I can only see how to do hashes at the moment. Simply replacing the hash with array gives:
    TIEARRAY not handled by object MLDBM::Sync at /usr/lib/perl5/site_perl +/5.6.0/MLDBM/Sync.pm line 60.
    Thanks
      Just put an array ref in one of the hash values. It works like MLDBM. $tied_hash{my_array} = [1,2,3];
        Im having a lot of trouble getting my head round this, sorry to be a nuisance. Ive tried the following:
        #!/usr/bin/perl -w use MLDBM::Sync; use Fcntl qw(:DEFAULT); $tied_hash{list} = [1,2,3,4,5]; #my $sync_dbm_obj = tie %tied_hash, 'MLDBM::Sync', '/tmp/mldbmsync', O +_CREAT|O_RDWR, 0640; push @{$tied_hash{list}},6; @values = @{$tied_hash{list}}; print @values;
        which prints 123456 as you would expect, but as soon as I uncomment the tie, nothing is printed.
        TIA