you could split on
colon space and then use
map to ensure the order of your values matches the order of your keys... but, as Transient stated, your order is already ok
my %hash;
while ( <DATA> )
{
chomp;
my @ar = split /\: /,$_;
$hash{$ar[0]} = $ar[1];
}
my @keys = keys %hash;
my @values = map { $hash{$_} } @keys;
print join ",",@keys;
print "\n";
print join ",",@values;
print "\n";
__DATA__
Update Time: 2005.04.27 15:44:12
Targets: 4
Complete: 4(100%)
Waiting: 0
Waiting,Targets,Update Time,Complete
0,4,2005.04.27 15:44:12,4(100%)