I am doing this script in my workplace, and we are not allowed to add any external (cpan) library. Is there another solution?

Sure. Your employer could hire someone to develop a program to do what you're trying to do and to provide support for that program. I think using CPAN would be a bit cheaper.

You could try to find a utility that can examine a file to determine if it is a link or not and call that from your Perl code. If its not freeware, then there will be a fee involved. If it is freeware, then I'm not seeing much difference between using that and using CPAN.

You could try to use a different scripting/programming language. In addition to any financial costs related to purchasing needed software (such as a compiler), there's the cost of time spent porting your Perl code to another language and possibly time lost for having to learn a new language. Using CPAN seems to be a faster and cheaper option in my mind.

If internet access is the issue, you could look into CPAN::Mini to put a CPAN mirror on a USB stick drive or network share that could be used. Or you could develop the code on a system with internet and CPAN access and then bundle your code into a stand alone executable. There are software packages that you can purchase that can help with that process. Or you can look at something like the pp utility from PAR::Packer or check out salva's Win32::Packer module.

Are there alternatives to using CPAN? Yes. I've listed some alternatives above and I'm sure there other individuals who could list more alternatives. But the alternatives may or may not be worth it for you and/or your employer.

If you've invested time to develop Perl code for what you're doing and you're asking for help on a Perl site, why not utilize the full capabilities of the language (such as CPAN)?


In reply to Re^4: Detecting if a folder is a symbolic link by dasgar
in thread Detecting if a folder is a symbolic link by ralphch

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.