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
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 thanksmy $x; $x = system("which perl"); print "-- $x --"; #this will print: /usr/bin/perl # -- 0 --
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: put system(); output into my $variable -- chech for installed aplications
by prasadbabu (Prior) on Jan 15, 2009 at 12:57 UTC | |
Re: put system(); output into my $variable -- chech for installed aplications
by Bloodnok (Vicar) on Jan 15, 2009 at 12:57 UTC | |
Re: put system(); output into my $variable -- chech for installed aplications
by Corion (Patriarch) on Jan 15, 2009 at 12:59 UTC | |
Re: put system(); output into my $variable -- chech for installed aplications
by 13warrior (Acolyte) on Jan 15, 2009 at 17:17 UTC | |
Re: put system(); output into my $variable -- chech for installed aplications
by repellent (Priest) on Jan 15, 2009 at 18:22 UTC | |
Re: put system(); output into my $variable -- chech for installed aplications
by bingos (Vicar) on Jan 15, 2009 at 20:44 UTC |
Back to
Seekers of Perl Wisdom