I tried looking on both: Linux and Windows in %ENV variable. It doesn't have any common variable names, except for PATH, that's not very useful.
Also, I've looked at results on both systems from the File::BaseDir module. It shows good results linux, but empty results on windows.
Is there some other preinstalled module, or some command, that I can use to return the standard paths, such as:
libdir
progdir
confdir
homedir
userdir
Are there some variables or standard modules, that can determain standard system dirs, depending on which os the perl program is being launched?

Update:

Ok, I've figured out what to do:
I will create a file, called config.pl, for example, with code:
#Determine 1 path, except for cwd (current working directory), #Where perl looks for libraries: my $libPath = ''; for(@INC){ unless($_ eq '.'){ $libPath = $_; last; } } #Then, install the library, that will determain all the OS specific pa +ths, #that can be used for further execution and installation of perl progr +am.
When this library will be called, perl program doesn't need to know it's, since it will be already located in one of the paths, that perl looks in.

Running this code on 2 OSes, gave me the following results, so far:

Lin: /etc/perl Win: C:/Perl/site/lib

In reply to 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.