in reply to Re^2: What script is this, and where is it? (Re: who am I?)
in thread who am I?
Edit: claims withdrawn. See below. Original message preserved below the jump.
*cough* ... look again.
'/var/tmp/otherdir/symdir/../datadir' => '/var/tmp/otherdir/datadir' '/var/tmp/mydir/../datadir' => '/var/tmp/datadir'
You'll only ever get the same location if you are on the same directory level as the directory you symlink to. I suppose I should have made it easier to see by changing out /var/tmp/otherdir with just /tmp or some such.
Edit:
Here's the result if you make the last symlink just into /tmp:
Does that make it clearer for you?Finding a data path: dirname($name):/tmp/../datadir dirname(rel2abs($name)):/tmp/../datadir dirname($0):/usr/local/bin/../datadir dirname(rel2abs($0)):/usr/local/bin/../datadir $FindBin::RealBin:/var/tmp/mydir/../datadir
Edit 2:
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.
Specifically, I find:
less readable thandirname(rel2abs($0)) . "/../datadir"
because of the nested parens.$FindBin::RealBin . "/../datadir"
|
|---|