Peter Lemus writes ..

>Please provide an example on how I can create the log
>file of a perl script, something like MMDDYYYY.log.
>I'll like to use the current Month, Day, and Year.

well .. assuming that your program is only run once (ie. two copies can't be
running at the same time - so there are no locking issues) .. the following
will open a log file

  my($day,$month,$year) = (localtime)[3..5];

  open LOG, '>>'. sprintf( '%02d%02d%4d' => $month+1, $day, $year+1900)
    or die "Bad open: $!";

  # then you would just print to the LOG filehandle

  print LOG "Here's a log message\n";

-- 
  jason king

  In Fort Madison, Iowa, the fire department is required to practice
  fire fighting for fifteen minutes before attending a fire. -
  http://dumblaws.com/

Reply via email to