in reply to Re: Recursively walk up a directory tree
in thread Recursively walk up a directory tree

I believe you actually meant "distribution" if I've understood what you meant correctly. Semantics, I know, but an important distinction.

  • Comment on Re^2: Recursively walk up a directory tree

Replies are listed 'Best First'.
Re^3: Recursively walk up a directory tree
by Anonymous Monk on Feb 10, 2018 at 17:41 UTC

    I believe you actually meant "distribution" if I've understood what you meant correctly. Semantics, I know, but an important distinction.

    Hehe,

    OP posts some code and asks Is there anything more elegant than this?

    Yeah, its called a module.

    Instead of doing ... 20 lines to modify global variable ... do use HideTwentyLines; and

    elegance achieved

      Hidden and elegant are not synonymous. The @INC manipulation was a solid clue, as 1nickt confirmed, that modules might be a poor suggestion; especially wrapped in snark empty of discussion, caveat, or example. There is little less elegant, proper, or convincing than–

      a title

      –as a punchline. Unless it's The Aristocrats! of course.

      A reply falls below the community's threshold of quality. You may see it by logging in.

      Yeah, its called a module.

      Given that the purpose of finding the base directory is to be able to add the lib directory to @INC, how do you suggest such a module could be loaded?


      The way forward always starts with a minimal test.

      Ok, I did misunderstand. I thought you were referring to packaging the code into a distribution :)