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:
That sets me thinking, what exactly is the difference between the two. Can they be different? When?unless ($0 eq __FILE__) .....
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Difference between $0 and __FILE__
by BrowserUk (Patriarch) on Sep 26, 2012 at 04:28 UTC | |
Re: Difference between $0 and __FILE__
by pobocks (Chaplain) on Sep 26, 2012 at 04:45 UTC | |
by solegaonkar (Beadle) on Sep 26, 2012 at 05:10 UTC | |
Re: Difference between $0 and __FILE__
by BitDreamer (Sexton) on Jul 20, 2017 at 19:04 UTC | |
by Your Mother (Archbishop) on Jul 21, 2017 at 05:32 UTC |
Back to
Seekers of Perl Wisdom