Hello Rajeev,

Saturday, July 07, 2001, Rajeev Rumale <[EMAIL PROTECTED]> wrote:

RR> But the what i need is the grep the name of the sub which is calling the
RR> loging sub.

do you read perldoc -f caller?
[...]
RR> sub debugLogger {

RR>     my $message = "@_";

RR>      $sub_name = ""; #  Get the subroutine name.This is what i need to grep.

($package, $filename, $line, $sub_name,
 $hasargs, $wantarray, $evaltext, $is_require) = caller(1);

RR>     open (LOGGER, ">> my.log") || die " unable to ope the log file";
RR>     print LOGGER "\n----------------------------------------";
RR>     print LOGGER "\nCalled from $sub_name.";
RR>     print LOGGER "\n$message";
RR>     print LOGGER "\n----------------------------------------";
RR>     close LOGGER;

RR> }

Best wishes,
 Maxim                            mailto:[EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to