in reply to Detection of main script / libraries
should work for what you are trying to do. This will tell you if the file (not the package) was executed directly. Your scripts will need to do:__FILE__ eq $0 and main();
before you can call any of the subroutines becauseBEGIN { require "myfile" }
insists on slapping on the .pm extension.use myfile;
Cheers,
Hrakaroo
|
|---|