CGI-Widget-DBI-Search
view release on metacpan or search on metacpan
lib/CGI/Widget/DBI/Search/Base.pm view on Meta::CPAN
my $class = ref($this) || $this;
my $self = ref($_[0]) =~ m/^CGI::Widget::DBI::/ && scalar(@_) == 1
? bless { %{ $_[0] } }, $class
: bless { @_ }, $class;
$self->initialize if $self->can('initialize');
return $self;
}
sub caller_function {
my ($self, $stacklvl) = @_;
my ($func) = ( (caller($stacklvl || 1))[3] =~ m/::([^:]+)\z/ );
return $func || '';
}
sub log_error {
my ($self, $msg) = @_;
my $method = $self->caller_function(2) || $self->caller_function(3); # check one level higher in case called from eval
my $logmsg = (ref($self)||$self).'->'.$method.': '.$msg;
if (blessed($self->{r}) && $self->{r}->can('log_error')) {
$self->{r}->log_error($logmsg);
} elsif (ref $self->{parent} and ref $self->{parent}->{r} eq 'Apache') {
( run in 0.250 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )