in reply to Re: Difference between $0 and __FILE__
in thread Difference between $0 and __FILE__

Good point; part of why I eschew chdir style code. A little more on your call out–

package AB; # File: /Users/moo/AB.pm use strict; use Path::Tiny; sub ohai { __FILE__ } sub ohai_der { path(__FILE__)->absolute } 1;
moo@cow[54]~>perl -MAB -le 'print AB->ohai; print AB->ohai_der' AB.pm /Users/moo/AB.pm
moo@cow[55]~>perl -MAB -le 'chdir "/tmp"; print AB->ohai; print AB->oh +ai_der;' AB.pm /private/tmp/AB.pm