Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
the problem is $sample has a value = 0 where am i wrong?$sample = system("./my_command"); #the system call returns a string li +ke "Intel CPU" if ($sample = "Intel CPU") { print "Intel CPU Found"; } else { exit(0); }
janitored by ybiC: balanced <code> tags around code sample, as per Monastery convention
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: assigning system command output to a variable
by Paladin (Vicar) on Sep 02, 2003 at 21:48 UTC | |
|
Re: assigning system command output to a variable
by bobn (Chaplain) on Sep 02, 2003 at 21:43 UTC | |
|
Re: assigning system command output to a variable
by Rex(Wrecks) (Curate) on Sep 02, 2003 at 21:50 UTC | |
|
Re: assigning system command output to a variable
by anoxer (Initiate) on Sep 02, 2003 at 22:13 UTC |