enlight
09-18-2002, 08:16 PM
Hi all,
i have written a bubblesort function in php and because getting to know perl i "ported" it to perl.
But one thing is very funny to me.
Definining:
@unsorted = (3,2,5);
and executing a print:
print $#unsorted;
tells me that the array or list has 2 entries. Filling the list with more keys always does the same wired thing:
returns a number which is always one smaller than it should be.
Probably i am using the # wrong or i missed using a special function.
May anyone tell me what went wrong ?
thanks in advance
-enlight
i have written a bubblesort function in php and because getting to know perl i "ported" it to perl.
But one thing is very funny to me.
Definining:
@unsorted = (3,2,5);
and executing a print:
print $#unsorted;
tells me that the array or list has 2 entries. Filling the list with more keys always does the same wired thing:
returns a number which is always one smaller than it should be.
Probably i am using the # wrong or i missed using a special function.
May anyone tell me what went wrong ?
thanks in advance
-enlight