hi i'm looking for a way to put result of a system('which perl') into my pre-defined variable.. but only for one system function , i do not want this to be the case for the rest of the system calls. something like my $x;
$x = system("which perl");
print "-- $x --";
#this will print: /usr/bin/perl
# -- 0 --
the reason why i'm asking this question is, i want to check if some of the applications are installed on my os (windows/linux), but they probably are not installed in the right place, but rather just added into the $PATH additionally. so this looked like the quickest and most portable way to do this. any alternatives are welcomed. <>
p
thanks
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|