B
Brady
hi, all,
i want to have a sub debug, which takes a string as a parameter, and
print the file name and line number of the place invoking the sub.
I tried to :
in main.pl:
if ($something_is_wrong) {
Mylib:
ebug("wrong!!!");
}
in Mylib.pm
sub Debug()
{
print STDERR, "__FILE__:__LINE__", @_;
}
but, the __FILE__ and __LINE__ is the Mylib.pm and the line number of
Mylib.pm.
how to get the caller's place?
thanks & best wishes!
/Brady
i want to have a sub debug, which takes a string as a parameter, and
print the file name and line number of the place invoking the sub.
I tried to :
in main.pl:
if ($something_is_wrong) {
Mylib:
}
in Mylib.pm
sub Debug()
{
print STDERR, "__FILE__:__LINE__", @_;
}
but, the __FILE__ and __LINE__ is the Mylib.pm and the line number of
Mylib.pm.
how to get the caller's place?
thanks & best wishes!
/Brady