in reply to Re^4: How to determine absolute path of current Perl file?
in thread How to determine absolute path of current Perl file?

thanks for your clarification RonW

So using a BEGIN block inside a module to be used it's like to say: as soon as possible or even sooner.

#TestBegin.pm use strict; use warnings; BEGIN{print "inside BEGIN in the module ",__FILE__,"\n"} print "in the module ",__FILE__,"\n"; 1; perl -e "print qq(in the program $0\n);BEGIN{print qq(BEGIN in the pr +ogram $0\n)}" -MTestBegin inside BEGIN in the module TestBegin.pm in the module TestBegin.pm BEGIN in the program -e in the program -e
And the only possibility to fail is:
perl -e "print qq(in the program $0\n);BEGIN{print qq(BEGIN in the pr +ogram\n)}use TestBegin;" BEGIN in the program inside BEGIN in the module TestBegin.pm in the module TestBegin.pm in the program -e

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.