kempis555
Programmer
- Jan 2, 2001
- 77
Is there any variable or function that I can use to know which subroutine is currently being executed?
This would be a big help in speeding up programming.
For instance,
sub one{
open(INFILE, "infile.txt"
|| &bug("Couldn't open file in subroutine $which_subroutine"
;
...
}
sub two{
open(INFILE, "infile.txt"
|| &bug("Couldn't open file in subroutine $which_subroutine"
;
...
}
if the file can't be opened in sub one, it's $which_subroutine has a value of "one"... likewise "two" for two.
Or maybe there's a better way to do all this?
Thanks in advance
-kempis555
This would be a big help in speeding up programming.
For instance,
sub one{
open(INFILE, "infile.txt"
...
}
sub two{
open(INFILE, "infile.txt"
...
}
if the file can't be opened in sub one, it's $which_subroutine has a value of "one"... likewise "two" for two.
Or maybe there's a better way to do all this?
Thanks in advance
-kempis555