{ chomp; my $dataout = $_; my @bytes = unpack( 'x252' . 'H2' x200, $dataout); my ($blu, $red, $grn, $ylw) = (@bytes[0], @bytes[12], @bytes[56], @bytes[120]); my %humanize = ( 'blu' => 'Blue', 'red' => 'Red', 'grn' => 'Green', 'ylw' => 'Yellow' ); foreach my $index (blu, red, grn, ylw) { if (${"index"} != 01) { syslog('warning', "Color value bad $humanize{$index}"); $status_code = 1; } } }