in reply to RE: A Programmers Kong-an
in thread A Programmers Kong-an

Hmm, so the truly paranoid-but-clueless might do this:

use FileHandle; to_logfile($message) or to_backup_logfile($message, $logfilename); sub to_backup_logfile { my ($message, $logfilename) = @_; my $bulog = new FileHandle "$logfilename.bak" or to_backup_logfile("Couldn't write $message to $logfilename!", +"$logfilename.bak"); print $bulog $message; }

Well, I suppose this code might tell you *something* useful =)

Update I was viewing turnstep's reply, below, in Mozilla M18 and everything after my <code> tag got deleted. Curse the developing lizard, but praise the project!

Replies are listed 'Best First'.
RE: RE: RE: A Programmers Kong-an
by turnstep (Parson) on Oct 16, 2000 at 19:32 UTC

    Actually, I started to write, but then resisted, a recursive subroutine that keeps opening (randomly named?) error files, and passing the names of all the previous error logs that it could not open until we run out of memory. Then maybe *that* error message will show up somewhere. :)

      You remind me of a programmer I heard about who was developing a big system and noticed that some of his daemons were unreliable. So he began writing watchers to restart things, make sure things got started in the right order, etc. And a few more watchers, some of which watched the watchers. And daemons of course would notice that their watchers were not up and would take appropriate action...

      He eventually cobbled together a working system.

      The machine rebooted and *then* he found out that he had managed to create a circular dependency among the watchers. There was literally no way to bring the system up without rewriting it! :-)

        Sed quis custodiet ipsos custodes?