August 1999 Perl Hardware Store Slide #20

Semaphore Files

         $FILE = '/data/hitcounter';
         print "Content-type: text/html\n\n";
         if (something()) {
           open F, $FILE or die ...;
           print while <F>;
         } else {
           open F, "> $FILE" or die ...;
           my $data = qx{some command};
           print F $data;
         }
         close F;


Next Copyright © 1998 M-J. Dominus