http://qs321.pair.com?node_id=1217312


in reply to Re^2: Overloading Weirdness
in thread Overloading Weirdness

Hello ikegami,

Thanks for that! I had a hard time trying to think of a situation in which the current working directory would be different to the script’s directory (in the absence of explicit calls to chdir, of course). Finally, the penny dropped: if I invoke a script foo/bar/baz.pl from the foo directory:

perl bar/baz.pl

the script’s directory is foo/bar, but the current working directory is still foo!

Thanks again,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^4: Overloading Weirdness
by ikegami (Patriarch) on Jun 24, 2018 at 23:12 UTC

    Yes, relpath/prog[1] and /abspath/prog[2], but even just prog[3]

    1. If relpath doesn't refer to the CWD.
    2. If /abspath doesn't refer to the CWD.
    3. If the $PATH entry used doesn't refer to the CWD.