Re: Special Var with Name of current scope or name of subroutine?
- From: Jenda@xxxxxxxxxxx ("Jenda Krynicky")
- Date: Tue, 02 Dec 2008 16:52:32 +0100
From: "Chas. Owens" <chas.owens@xxxxxxxxx>
On Tue, Dec 2, 2008 at 09:23, Chas. Owens <chas.owens@xxxxxxxxx> wrote:
On Tue, Dec 2, 2008 at 09:11, Deviloper <deviloper@xxxxxxxxxx> wrote:snip
Hi!
Is there a special variable or trick to get the name of the current scope or subroutine name?
Thanks,
B.
The caller* function will tell you information about the call stack
(including the current function):
Sometimes I answer without questions with giving a lot of thought to
what may be the driving cause for the question. What do you want to
know the function name for? debugging? (a real debugger is better than
print statements)
Not always. Imagine a multithreaded/forking application. Or a program
that only works or only exhibits the problem in a special context in
which you cannot attach the debuger. (Windows Service/daemon, remote
machine).
A nice, well positioned
print "blah blah\n" if DEBUG;
can help a lot at times.
When it comes to logging (for debugging purposes)
http://search.cpan.org/search?query=Devel::TraceSubs&mode=all may be
easier.
Jenda
===== Jenda@xxxxxxxxxxx === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
.
- References:
- Special Var with Name of current scope or name of subroutine?
- From: Deviloper
- Re: Special Var with Name of current scope or name of subroutine?
- From: "Chas. Owens"
- Re: Special Var with Name of current scope or name of subroutine?
- From: Chas. Owens
- Special Var with Name of current scope or name of subroutine?
- Prev by Date: Starting with ::
- Next by Date: Re: Starting with ::
- Previous by thread: Re: Special Var with Name of current scope or name of subroutine?
- Next by thread: Starting with ::
- Index(es):
Relevant Pages
|