in reply to Calling a variable value as a variable

my ($blu, $red, $grn, $ylw) = (@bytes[0], @bytes[12], @by +tes[56], @bytes[120]);

If you had warnings enabled you would have received these messages:

Scalar value @bytes[0] better written as $bytes[0] at -e line n. Scalar value @bytes[12] better written as $bytes[12] at -e line n. Scalar value @bytes[56] better written as $bytes[56] at -e line n. Scalar value @bytes[120] better written as $bytes[120] at -e line n.

As to your problem, use a hash:

{ chomp; my $dataout = $_; my %humanize; @humanize{ qw/ Blue Red Green Yellow / } = ( unpack 'x252 +' . 'H2' x 200, $dataout )[ 0, 12, 56, 120 ]; foreach my $index ( qw/ Blue Red Green Yellow / ) { if ( $humanize{ $index } eq '01' ) { syslog( 'warnin +g', "Color value bad $humanize{$index}"); $status_code = 1; } } }