Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Overloading Weirdness

by ikegami (Patriarch)
on Jun 23, 2018 at 15:31 UTC ( #1217284=note: print w/replies, xml ) Need Help??


in reply to Re: Overloading Weirdness
in thread Overloading Weirdness

"." means the current work directory, not the script's directory.

use lib qw(.);
should be
use FindBin qw( $RealBin ); use lib $RealBin;

Replies are listed 'Best First'.
Re^3: Overloading Weirdness
by Athanasius (Archbishop) on Jun 24, 2018 at 04:11 UTC

    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,

      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.
Re^3: Overloading Weirdness
by pudge (Sexton) on Jun 23, 2018 at 21:18 UTC
    Regardless, if the difference is that the class is in a separate file, that would be super weird.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1217284]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2022-01-23 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?