in reply to Easy, elemental, but cool debug trick.
sub debug_log { @_ == 2 or confess "Incorrect number of arguments"; my ($section, $action) = @_; my $userid = 0; my $string = 0; $userid = $globalUserID || "<nobody>"; $string = sprintf ("%s %s %s:%s\n", scalar localtime, $userid, $sec +tion, $action); open (SINK, ">> /home/httpd/somedir/logfile") or confess "Can't ope +n logfile"; print SINK $string; close (SINK) or confess "Can't close logfile"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Easy, elemental, but cool debug trick.
by ask (Pilgrim) on May 25, 2000 at 13:43 UTC |