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
In reply to assigning system command output to a variable by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |