Leser: 24
1 2 3 4 5
my @array; $array[0] = 'A'; $array[1] = 'B'; $array[2] = 'C'; print "Liste:\n" . (join("\n",map{defined($_) ? "Wert => $_" : ''} @array)) . "\n";
1 2 3 4 5
my @array; $array[0] = 'A'; $array[1] = 'B'; $array[2] = 'C'; print "Liste:\n" . (join("\n",map{defined($_) ? "Wert => $_" : ''} @array)) . "\n"
1 2 3
print "Liste:\n" . (join "\n", map { defined ($array[$_]) ? "Wert $_ => $array[$_]" : '' } 0 .. $#array) . "\n";