http://qs321.pair.com?node_id=736530

baxy77bax has asked for the wisdom of the Perl Monks concerning the following question:

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