I would like to verify that an external command is available or not, strictly without executing it.
I know there are several ways for executing an external command, as described here executing_external_commands.

Why i don't want to execute and check ?
Because, i wish to check commands such as rm, tar. If i want to check the rm by executing then, i should create a temporary file and for that i should whether i have permission or not and the process goes recursive.
If it is tar, it may initiate archiving a big directory. So to avoid all those things i would like to check whether a command exists, and the current user can execute it or not in effective manner.

Any good option is appreciated.
-- Sathiyamoorthy

In reply to How to find whether an external commands exists by sathiya.sw

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.