RE: getting the calling function name.

2001-08-07 Thread Peter Cornelius
Maybe I'm missing something, but doesn't this work? use strict; use warnings; sub routine1 { print "Calling routine2...\n"; routine2(); print "Done\n"; } sub routine2 { print "\tCalled by ", (caller(1))[3], "\n"; } routine1(); output: Calling routine2... Called by main

Re: getting the calling function name.

2001-08-07 Thread Dwalu Z. Khasu
> =>------------ =>- =>Artificial Intelligence is no match for Natural Stupidity. => =>- => => =>- Original Message --

Re: getting the calling function name.

2001-08-07 Thread Curtis Poe
--- Rajeev Rumale <[EMAIL PROTECTED]> wrote: > Thanks Dwalu, > > But the what i need is the grep the name of the sub which is calling the > loging sub. > As you have suggested "caller" only gives only the name of current sub > routine that is &debugLogger it self. > And I had to do call the "cal

Re: getting the calling function name.

2001-08-07 Thread Ryan Davis
t. I know that's a lot more work, but it might solve the problem. - Original Message - From: Rajeev Rumale <[EMAIL PROTECTED]> To: Dwalu Z. Khasu <[EMAIL PROTECTED]> Cc: Beginners-Cgi (E-mail) <[EMAIL PROTECTED]> Sent: Saturday, July 07, 2001 1:22 AM Subject: Re:

Re[2]: getting the calling function name.

2001-08-07 Thread Maxim Berlin
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 t

Re: getting the calling function name.

2001-08-06 Thread Rajeev Rumale
- - Original Message - From: "Dwalu Z. Khasu" <[EMAIL PROTECTED]> To: "Rajeev Rumale" <[EMAIL PROTECTED]> Cc: "Beginners-Cgi (E-mail)" <[EMAIL PROTECTED]> Sent: Monday, August 06, 2001 3

Re: getting the calling function name.

2001-08-06 Thread Dwalu Z. Khasu
See perldoc -f caller On Mon, 6 Aug 2001, Rajeev Rumale wrote: =>Hello Every Body, => =>I need some help. =>I am using a sub routine to log all the messages to be used for debugging =>purpose. =>ie. &debugLogger($debug_message); =>Since very similare kind of messages are genrated at serveral pl

getting the calling function name.

2001-08-06 Thread Rajeev Rumale
Hello Every Body, I need some help. I am using a sub routine to log all the messages to be used for debugging purpose. ie. &debugLogger($debug_message); Since very similare kind of messages are genrated at serveral places, I add the function name. i.e., &debugLogger("inside x \n $debug_messa