Help for this page

Select Code to Download


  1. or download this
    use warnings;
    use strict;
    
  2. or download this
    
    chomp($pid  = $$);
    
  3. or download this
    
    $LOCK_EXCLUSIVE = 2;
    $UNLOCK         = 8;
    
  4. or download this
    use Fcntl ':flock';
    
  5. or download this
    
    $fifo             = "ENV{HOME}/a_file";
    
  6. or download this
    $fifo             = "$ENV{HOME}/a_file";
    
  7. or download this
    
    close(FILE) || warn "update queue file exited $?\n";
    
  8. or download this
    
    close(LOCK) || warn "lock file exited $?\n";;
    $str=`cat $fifo.lock`;
    
    flock LOCK, $UNLOCK;
    
  9. or download this
    
    system("rm $fifo.lock");
    
  10. or download this
    #!/usr/local/bin/perl
    use warnings;
    ...
    __END__