CGI-Log

 view release on metacpan or  search on metacpan

Log.pm  view on Meta::CPAN

628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
##   - the output moves from the top down to the caller.. (i.e. starts at "main")
##
##
##
{
        my($self) = @_;
 
        ## CGI::Log->_find_self(\$self);             ## we have "found outselves" (what object
                                                        ## reference we are, by the time we get here.)
 
        my @call = caller(1);
        my $line = $call[2];
        my $cnt = 2;
 
        my @stack;
 
        while (defined($call[0]))
        {
                my $caller = $call[0];
                @call = caller($cnt);
                $call[3] = $caller if (!defined($call[3]));
                unshift(@stack, $call[3] . ":" . $line);
                $line = $call[2];
                $cnt++;
        }
        return("[" . join(" ", @stack) . "]");
}
 
##################################################
##



( run in 0.300 second using v1.01-cache-2.11-cpan-5f2e87ce722 )