Yes, you are correct, but... this type of thing I wanted to get away from, because it's a pain to add the same code to every program, that you do, so, exactly, I've put code similar to that in a library, that was placed to /etc/ folder and started just calling: require /etc/somelib.pl, like that.

This approach has several problems:
1) it wouldn't work on most public webservers, because, I don't have a writeable access to /etc folder on a shared computer.
2) Windows has a different path for such folder, i.e.: c:\users\appdata\, or c:\program files\all users\application data, or it could even be on a different drive.

So, I am facing not only a crossplatformness problem, but even on the same OS family, it could be located in different place, depending on the computer.

After some further thought, that none of the answers gave me a desirable solution, I've came up with a solution, listed in my message update, that I find reasonable for the task: creating a crossplatform installer for sort of script 'boot loader' library.
A simple library, that will be installed to a standard perl path, that will determine everything else in the currently running system.

Later, I will fix it to detect the path, that the installer can write to, so the installer doesn't have to have super user privileges, I hope.


In reply to Re^6: 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.