Halihallo Andreas
Am besten schreibe ich mal, wie ich es in PHP machen würde:
$array = explode("\n",$string);
foreach($array as $tmp){
list($key,$value) = explode(":",$tmp);
$mein_array[$key] = $value;
}
Am besten schreibe ich gleich, wie ich es in Perl machen würde: (*g*)
my @array = split( /\n/, $string );
my %mein_array; # wobei es ein Hash ist ;)
foreach my $tmp (@array) {
my ($key, $value) = split( /:/, $tmp, 2 );
$mein_array{$key} = $value;
}
Viele Grüsse
Philipp