From: Michelle D. <md...@oc...> - 2012-07-28 21:55:27
|
I'm planning to call it like this: &setdev(kitchen_light,'off'); Thanks ________________________________________ From: Jim Duda [ji...@du...] Sent: Saturday, July 28, 2012 11:58 AM To: mis...@li... Subject: Re: [mh] Perl help: passing device name as parameter On 07/28/2012 09:08 AM, Michelle Dupuis wrote: > 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 Michelle, You need to show us the code which is calling this method. You are using $devname as a pointer to an object. Is devname indeed an object? my $devname = new someObject( ); Jim ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ________________________________________________________ To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 |