Within a module (say a.pm) used from a program (say b.pl), __FILE__ will be a.pm but $0 will be b.pl.
The test you posted checks whether the file that contains it is being run as a 'main' program, or is being used or required, or done or eval'd.
In reply to Re: Difference between $0 and __FILE__
by BrowserUk
in thread Difference between $0 and __FILE__
by solegaonkar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |