in reply to System() or the like

Use backticks:

$run="snmpwalk $host $opt_c ifType.".$thisport; $type=`$run`; print "$MAC $type $ifName $vlan $host\n";

More information at perlfunc:system; in particular, the second paragraph.

HTH