home *** CD-ROM | disk | FTP | other *** search
/ ftp.cse.unsw.edu.au / 2014.06.ftp.cse.unsw.edu.au.tar / ftp.cse.unsw.edu.au / pub / doc / languages / perl / nutshell / apb / syslog < prev    next >
Encoding:
Text File  |  1992-10-18  |  439 b   |  13 lines

  1. require "syslog.pl";
  2.  
  3. &openlog($program,'cons,pid','user');
  4. &syslog('info',"The camel's nose is in the tent");
  5. &syslog('mail|warning','My watch reads %d', time);
  6. &closelog();
  7. &syslog('debug',
  8.    'This is a test of the emerging broadcast system');
  9. &openlog("$program $$",'ndelay','user');
  10. &syslog('notice',"warp: somebody's playing during work time");
  11. syswrite(STDOUT,$pig,length($pig)) ||
  12.     &syslog('info','problem was %m');  # %m == $!
  13.