Soham Das wrote:
> Hello All,
>
> I wanted some guidance with these questions of mine:
>
> a.. How do I initialise an array of a definite size with
> zero. Say the C equivalent of such a statement will be:
>
>                    int a[125];
>                    for(i=0;i<125;i++)
>                    a[i]=0;
>
my @array;
$array[$_] = 0 for 0..125;

> b. Is it possible, to have dates as index? I am trying to
> parse and process data corresponding to a list of "trades"
> I have made(financial trades) and want to see, how my
> portfolio varies with time. So is it possible to do in
> such a way?
>
Here you're looking for an associative array, also known
as a hash.

Hash Crash Course:
http://www.perl.com/pub/a/2006/11/02/all-about-hashes.html
How Hashes Really Work:
http://www.perl.com/lpt/a/679

--
Ron


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to