http://www.perlmonks.org?node_id=995692

solegaonkar has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks, Often wondered what is the difference between the two special values $0 and __FILE__ in a Perl script. But always brushed it off saying "Perl has many ways to do anything". But, today, I saw some code containing:
unless ($0 eq __FILE__) .....
That sets me thinking, what exactly is the difference between the two. Can they be different? When?