in reply to Why does this not work? - Can't call method on an undefined value!!!
The error message means that $vm->guest->net is undefined. I'm not familiar enough with the VMWare client API to tell when that is the case, but it seems it can happen.