From: Brian W. <bri...@78...> - 2008-12-19 01:28:10
|
tecman wrote: > I have the following code which gives the error in the SecAnnc routine: > object is Error in user code: Can't use string > ("./../code/test/organizer_events.") as a HASH ref while "strict refs" in > use at (eval 281488) line 2950. > > ----------------------------------------------------------------------------------------------------------- > sub SecAnnc > { > my ($object) = @_; > print_log "trying announce"; > print_log "ANNOUCING $object->{object_name} is $object->{state}"; > > } #sub AN--------------------------------------------------- > > > my $klights = new Group($test_light1, $test_light2); > for my $sec_sensor (list $klights) { > if ($sec_sensor->{state_now} eq 'on') > { > print "item $sec_sensor->{object_name} just turned on\n"; > &SecAnnc($sec_sensor); #announce trip > } > } > ---------------------------------------------------------------- > > > Can someone please give me an idea of how to do this type of thing? Drop the {} around state, state_now && object_name |