in reply to Re^2: __FILE__
in thread Debugging CGI/PERL

You can also try caller(), but I'm not sure how that behaves inside an IF.

It works the same way it does anywhere else; nothing if does intrinsically changes the call stack.