# Defines logging groups in terms of room: if device's room maatches room name or if device name is listed separately in hash, then is logged into same log: %Log_rooms = ( "gallery" => { 'BM_shutts_south_00' => 1, 'BM_shutt_north_00' => 1 }, "kitchen" => { }, "office" => { }, "living" => { }, "utility" => { }, "kurilnica" => {}, "lobby" => { }, "toilet" => { } ); #### use Data::Dumper; use Safe; my %Log_rooms; my $config_file ="./Log.conf"; if (-e $config_file) { print "File Exists!"; # my $comp = new Safe; # my $return =$comp->reval($config_file); my $return = do $config_file ; warn "couldn't parse $config_file: $@" if $@; warn "couldn't do $config_file: $!" unless defined $return; warn "couldn't run $config_file" unless $return; } else { %Log_rooms = ( "default" => { 'BM_shutts_south_00' => 1, 'BM_shutt_north_00' => 1 } ); }; print "################################################################################\n"; print Data::Dumper::Dumper(%Log_rooms);