Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^5: How to determine absolute path of current Perl file?

by Discipulus (Canon)
on Feb 29, 2016 at 22:51 UTC ( [id://1156489]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1156489]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-24 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found