103 |
Secvenţă cod (tst25.pl) |
|
Rezultat în consola text |
|
|
|
|
|
|
Secvenţă cod (tst25.pl) |
|
Rezultat în consola text |
|
|
|
Secvenţă cod (tst26.pl) |
|
Rezultat în consola text |
@array = (14, "cheeseburger", 1.23, -7, "toad"); $count = 1; while ($count <= @array) { print("element $count: $array[$count-1]\n"); $count++; } |
|
element 1: 14 element 2: cheeseburger element 3: 1.23 element 4: -7 element 5: toad |
Secvenţe cod care ilustrează cum se extrage o bucată de array sunt următoarele.
Secvenţă cod (tst27.pl) |
|
Rezultat în consola text |
|
|
The first element of subarray is 2 The second element of subarray is 3 |
|
|
2345 |
|
|
234 |
|
|
The array slice is: two four five six eight |
|
|
old1 new2 new3 old4 |
|
|
one three four five five |
© Cornel Mironel Niculae, 2003-2004
13-Nov-2009