I have a simple subroutine which will accept a device name and state as parameters, and then needs to set the device to that state:
 
sub setdev {
  my ($devname, $devstate) = @_;
 $devname->set($devstate)
}
 
This doesn't seem to work since misterhouse is looking for a device named 'devname'.  How can I tell perl to use the value held inside the devname variable?
 
Thanks