Soham Das wrote:
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;
You easily can, but why would you?
It is often a sign of b
r...@i.frys.com wrote:
Soham Das wrote:
int a[125];
for(i=0;i<125;i++)
a[i]=0;
my @array;
$array[$_] = 0 for 0..125;
s/125/124/
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: be
Soham Das wrote:
My agenda actually is two pronged. I have read Beginning Perl and a bit of
Intermediate Perl, though was able to solve individual problems, but I was not
sure,if I can code myself out of a wet paperbag.
So I thought, lets chuck theory. Its better to get hands dirty with some r
Soham
- Original Message
From: Shawn H Corey
To: Uri Guttman
Cc: Soham Das ; beginners@perl.org
Sent: Monday, 28 September, 2009 10:45:33 PM
Subject: Re: Arrays, Dates, Indexing and Initialisation
Uri Guttman wrote:
> only for ++/-- and +=/-= will that work with no warnings. if he uses an
> un
Uri Guttman wrote:
only for ++/-- and +=/-= will that work with no warnings. if he uses an
undef value in another arithmetic expression it will warn.
Also, undef values work in if/unless and while/until conditions.
Usually when you see indexes used with arrays, it is because the
programmer do
> "SHC" == Shawn H Corey writes:
SHC> Soham Das wrote:
>> 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;
SHC> Not needed. Perl assume zero if a non-ex
> "JK" == Jenda Krynicky writes:
>> >
>> > a.. How do I initialise an array of a definite size with
>> > zero. Say the C equivalent of such a statement will be:
>> my @array;
>> $array[$_] = 0 for 0..125;
JK> my @array = (0) x 126;
and a question for the OP is why do you need t
Thanks Shawn, yes hashes I guess will be the way to go forward.
Soham
- Original Message
From: Shawn H Corey
To: Soham Das
Cc: beginners@perl.org
Sent: Monday, 28 September, 2009 9:50:18 PM
Subject: Re: Arrays, Dates, Indexing and Initialisation
Soham Das wrote:
> a.. How d
Wow! sweet!
Hi Jenda, thanks for the help.
And I guess, for the dates problem I have to use hashes, eh?
Soham
- Original Message
From: Jenda Krynicky
To: beginners@perl.org
Sent: Monday, 28 September, 2009 9:50:40 PM
Subject: Re: Arrays, Dates, Indexing and Initialisation
Date
Soham Das wrote:
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;
Not needed. Perl assume zero if a non-existing element is u
Date sent: Mon, 28 Sep 2009 09:11:02 -0700
Subject:Re: Arrays, Dates, Indexing and Initialisation
From: r...@i.frys.com
To: "Soham Das"
Copies to: beginners@perl.org
> Soham Das wrote:
> > Hello Al
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++)
>
12 matches
Mail list logo