AMD 4.4.5 Switch User Manual


 
AMD Confidential
User Manual November 21
st
, 2008
160 Chapter 12: Command API
use Win32::OLE;
use Win32::OLE::Variant;
$Win32::OLE::Warn = 3;
$cmd = Win32::OLE->new('SimNow.Command')
or die "Cannot open SimNow.Command\n";
$MyResponse = Variant(VT_BSTR | VT_BYREF, "");
do {
print "simnow> ";
$CmdLine = <>;
chomp($CmdLine);
if ($CmdLine)
{
if ($cmd->Exec($CmdLine, $MyResponse))
{
print "$MyResponse\n";
}
else
{
$cmd->GetLastError($MyResponse);
print "Cannot Exec: $MyResponse\n";
}
}
} while ($CmdLine);
print "\ndone\n";
Example 12-1: Perl Sample CMDAPI Source Code