<?xml version="1.0" encoding="windows-1252"?>
<node id="995694" title="Re: Difference between $0 and __FILE__" created="2012-09-26 00:28:41" updated="2012-09-26 00:28:41">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;Within a module (say a.pm) [use]d from a program (say b.pl), __FILE__ will be a.pm but $0 will be b.pl.

&lt;p&gt;The test you posted checks whether the file that contains it is being run as a 'main' program, or is being [use]d or [require]d, or [do]ne or [eval]'d.


&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;p align=right&gt; [http://thebottomline.cpaaustralia.com.au/|RIP Neil Armstrong]&lt;/p&gt;&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
995692</field>
<field name="parent_node">
995692</field>
</data>
</node>
