on Thu, 05 Sep 2002 08:46:08 GMT, [EMAIL PROTECTED]
(Zanardi2k2) wrote:
> Felix Geerinckx wrote:
>
>> push @array, 3;
>>
>> is the same as
>> $array[2] = 2;
>> (...)
>
>
> Maybe a typo?
>
> push @array, 3;
>
> should be the same as
>
> $array[2] = 3;
Indeed.
Felix Geerinckx wrote:
> (...)
> Or, by using push, you take the next available position:
>
> push @array, 3;
>
> is the same as
> $array[2] = 2;
> (...)
Maybe a typo?
push @array, 3;
should be the same as
$array[2] = 3;
--
Zanardi2k2
--
To unsubscribe, e-m
on Tue, 04 Sep 2001 12:15:37 GMT, Quincy Ntuli wrote:
> I understand that perl desides how it stores data in an array.
Perl doesn't, you do. Data in an array is indexed by an integer. You, the
programmer, choses at which position you put your data:
$array[0] = 0;
$array[1] = 1;
Or,
As default it assumes ascii (alphanumeric data). So if you have
only numeric data then you need to change to
@sorted = sort {$a <=> $b} @list;
which would sort numerically if needed otherwise will sort as you
want.
Wags ;)
-Original Message-
From: Quincy Ntuli [mailto:[