[mh] Problem with timer variable

Paul Onley <[email protected]>
Newsgroups gmane.comp.misc.misterhouse.user
Message-ID <[email protected]>
I am by no means an expert in perl but I have managed to get by OK with 
mh for about 20 years. I only use a small portion of misterhouses 
capabillities but I vary much appreciate it's incredible flexibility.

I'm having a problem with some code I have written that I do not understand.

In my code I have a hash of motion sensors which points to hashes of 
each room, I would like to use:

     set $MotionSensors{$SensorID}{timer} $MotionSensors{$SensorID}{occupied_time}, $MotionSensors{$SensorID}{timer_cmd};

but get the error:



Error in user code file ./../data/mh_temp.user_code

   11/26/18 09:52:10 PM: syntax error at (eval 1086) line 4695, near "$MyMotionSen{"
Global symbol "$benchmark_tickcount" requires explicit package name at (eval 1086) line 4723.
Global symbol "$benchmark_tickcount" requires explicit package name at (eval 1086) line 4723.
syntax error at (eval 1086) line 4725, near ";

}"
syntax error at (eval 1086) line 4746, near ";

}"
syntax error at (eval 1086) line 4767, near ";

}"
BEGIN not safe after errors--compilation aborted at (eval 1086) line 4778.
  at ./mh line 31
         main::__ANON__('syntax error at (eval 1086) line 4695, near "$MyMotionSen{"\x{a}G...') called at (eval 1086) line 4778
Line 4690:  }else{
Line 4691:
Line 4692:  # print "set $MyMotionSen{$SensorID}{timer} $MyMotionSen{$SensorID}{occupied_time} $MyMotionSen{$SensorID}{timer_cmd} \n";
Line 4693:      eval ($MyMotionSen{$SensorID}{action});
Line 4694:
Line 4695:      set $MyMotionSen{$SensorID}{timer} $MyMotionSen{$SensorID}{occupied_time}, $MyMotionSen{$SensorID}{timer_cmd};
Line 4696:  }
Line 4697:
Line 4698:      if ( $MyMotionSen{$SensorID}{name} eq $MyMotionSen{$Lastsensor}{name} )
Line 4699:      {




However the following code works fine:


     $timer            = $MotionSensors{$SensorID}{timer};
     set $timer $MotionSensors{$SensorID}{occupied_time}, $MotionSensors{$SensorID}{timer_cmd};
  
  

Could someone explain to me what I am doing wrong? Thank You Paul

________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.