Assuming the format is the way you say it is, the following should work fine:
use strict;
use warnings;
my @keys = (
'Name',
'AlarmConsistencyMgr',
'AlarmForwarder',
'AlarmForwarderServer',
'alert_publisher',
'AnalogGatewayMain',
'AssetTracking',
'CallerPosition',
);
$_ = <DATA>; chomp;
my @vals = split /,/;
my %hash;
@hash{@keys} = @vals;
for (@keys) {
print "$_ -> $hash{$_}\n";
}
__DATA__
,,,X,X,,X,X,X,X,X,X,X,,,,,,,X,X,X,,,,X,,,,,,,,X,,,,,X,,,
Your problem was that hash keys are not stored in the order they're specified, so your initialization order had nothing to do with the order in which the values were assigned. You have to use an array to preserve order.