Are you claiming that you've located a Windows perl whose @INC consists only of C:/Perl/site/lib (and perhaps also .) ?
No, I am claming, that on windows, I find such path. I've never said, that that's the only path, I find.
I've read every post in this thread and I still struggle to understand what you are seeking.
I don't know, how much more clearly to explain, which I did several times and in different formulations.
How much more clearly I need to describe, that I need my programs to know system (independently of OS) paths with the least amount of code added to every program.
They need to know system common library paths, systemwide config paths, program/bin, etc., so my code was correct.
How do you think I would use the whole string of paths to get the final file?
From your code, I'd get:
"/etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /us +r/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 +/usr/local/lib/site_perl "
How do you think, it would be useful? How do you think, I would locate a final file with such a path?
If I would really need such a result, there is a better and shorter way to do it:
$libPath = join(" ", grep { $_ ne "." } @INC);
How do you think, I would put my libraries, finding system paths in this, "found" path? How would I do, even a simple thing, such as (with the resulted path from your suggested code)?:
&cp($file2Copy, "$libPath/$file2Copy");
No, I only need one (possibly, first found) path to place the common file to, and nothing is expected, that's why I need a way to determine the path. If I would "expect" some path, as you say, I would just use it, since, it would be on all systems, as "expected".
print "@INC\n";
And how do you think, this would be useful?

In reply to Re^2: standard library to return system paths by igoryonya
in thread standard library to return system paths by igoryonya

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.