Thread Syntax Zugriff Array Index (23 answers)
Opened by bianca at 2019-08-11 08:23

FIFO
 2019-08-11 10:49
#190356 #190356
User since
2005-06-01
469 Artikel
BenutzerIn

user image
Ja, mit map(), dann brauchst Du auch $idx nicht:

Code (perl): (dl )
@stats = map { $_->[0] eq 'RequestsD' ? [$_->[0], $_->[1] + 1] : $_ } @stats;


Edit: Wie rosti schon anmerkt, ist ein Hash meistens die bessere Wahl, wenn Du Datenpaare, hast, die eine eindeutige Zuordnung erlauben.
Last edited: 2019-08-11 10:53:58 +0200 (CEST)
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? -- Brian Kernighan: "The Elements of Programming Style"

View full thread Syntax Zugriff Array Index