Here is my code-
print $cpu_arch."\n";
if ($cpu_arch eq'AMD64') {
print "Remote machine is 64bit\n";
}
Depending upon the CPU architecture, $cpu_arch returns x86 or AMD64.
The problem is that no matter what $cpu_arch returns, the if loop condition is not getting satisfied. I’ve tried chomp’ing the $cpu_arch but that doesn’t seem to help either.
The operator for string is
eqas you have. Your issue isn’t in your operator it is in the data. More than likely you are buffering improperly ( change the$|variable ) or your$cpu_archhas trailing white-space. Or maybe you are looking for regex match and not literal match ( then you want/AMD64/)