On Tue, 10 Oct 2000, darren chamberlain wrote:
> Hi All.
>
> This is a curiosity question, mostly. I have a simple method of sending
> debugging messages to the error log:
>
> use constant DEBUG => 1; # Set to 0 to turn off debugging throughout
> sub debug ($) {
> if (DEBUG) {
> return carp sprintf "[%s] [%s] %s", scalar caller, scalar localtime, shift;
> }
> return 1;
> }
>
> which gets called as:
>
> debug("Entering handler");
>
> and in scripts, I get nicely formatted output (I split the lines here):
>
> [BGEP::Utils] [Tue Oct 10 13:24:33 2000] Getting date list at
> /usr/local/bin/foo.pl line 22
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> But under mod_perl, I'm getting:
>
> [BGEP::TestPkg] [Tue Oct 10 13:17:00 2000] Sending message to
> '[EMAIL PROTECTED]' at /dev/null line 0
> ^^^^^^^^^^^^^^^^
i cannot reproduce this. using the mod_perl-1.24_02-dev build,
i put your code into a Foo.pm, along with:
sub test {
print Foo::debug("test");
}
and called it like so from t/net/perl/test.pl:
use Foo ();
my $r = shift;
$r->send_http_header('text/plain');
Foo::test();
[Foo] [Thu Dec 21 20:20:29 2000] test at
/home/dougm/ap/build/mod_perl-1.24_02-dev/t/net/perl/test.pl line 6
i'm using Perl-5.7.0-dev. you might want to try 5.6.1-trial1. there
are some 5.6.0 bugs that clobber the Perl structure than maintains
filename:linenumber (PL_curcop), not sure if they're related to your case
or not.