in reply to how can i create a hash by reading an array

use strict; my %hash = (); while (<DATA>) { chomp; $hash{$1} = $2 if m/^(.*?)\s+(.*)$/; } print "$_ = $hash{$_}\n" for keys %hash; __DATA__ EVENT_LOG_EMITTER rtbd:service=EventEmitterService,name=EventLogEmitte +r,protocol=XML EVENT_LOG_EMITTER2 rtbd:service=EventEmitterService,name=EventLogEmitt +er,protocol=XML2