in reply to Re: What script is this, and where is it? (Re: who am I?)
in thread who am I?
All of those mechanisms break if the script is being called by a symlink, and particularly so if nested symlinks are involved. You need to readlink($0) if (-l $0) first,
Agreed.
Only FindBin correctly points you to the correct data directory location.
That's wrong.
is the same directory as/var/tmp/otherdir/symdir/../datadir
/var/tmp/mydir/../datadir
so you demonstrated that working with readlinked $0 works.
even then, it won't give you the same output as FindBin::RealBin.
Doesn't matter.
FindBin is more readable, though.
What good is readable if it doesn't work as well. And I don't see how dirname($script_qn) is less readable than $FindBin::RealBin.
|
|---|