Next Trivial Utilities 59

mark: Tying

        my (@SEQUENCE, $TIED);
        my $folder;
        if ($ARGV[0] =~ /^\+(.*)/) {
          $folder = shift;
          mhc "folder -nocreate $folder";
          $folder =~ s/^\+//;
        } else {
          $folder = mhc "folder -fast";
        }
        my $seqfile = seqfile($folder);
        my $TIED = tie my @SEQUENCE, 'Tie::File', $seqfile 
          or die "Couldn't tie $seqfile: $!";
        $TIED->flock(LOCK_EX) or die "Couldn't lock $seqfile: $!";
        unless (@ARGV) {
          list_seqs();
          exit 0;
        }


Next Menu Copyright © 2012 M. J. Dominus