Re: how to initialize an array of unknown size to 0?

2004-02-01 Thread Jeff 'japhy' Pinyan
On Feb 1, R. Joseph Newton said: >vaishnavi krishnamurthy wrote: > >>Can anyone tell me how I can do the following - all the elements in my >>array of unkown size should be initialised to the value 0 ? > > thanks, >>vaish. > >No. If the array is of uknown size, it is not possible to do *anything*

Re: how to initialize an array of unknown size to 0?

2004-02-01 Thread R. Joseph Newton
vaishnavi krishnamurthy wrote: > Hello, > > Can anyone tell me how I can do the following - all the elements in my array of > unkown size should be initialised to the value 0 ? > > thanks, > vaish. No. If the array is of uknown size, it is not possible to do *anything* to all elements. Theref

Re: how to initialize an array of unknown size to 0?

2004-02-01 Thread R. Joseph Newton
"Charles K. Clarkson" wrote: > vaishnavi krishnamurthy <[EMAIL PROTECTED]> wrote: > > : Can anyone tell me how I can do the following - all the > : elements in my array of unknown size should be initialized > : to the value 0? > > Assuming your array has only one dimension: > > @array = (0

Re: how to initialize an array of unknown size to 0?

2004-01-21 Thread John W. Krahn
Vaishnavi Krishnamurthy wrote: > > Hello, Hello, > Can anyone tell me how I can do the following - all the elements in my > array of unkown size should be initialised to the value 0 ? @array = (0) x @array; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED]

RE: how to initialize an array of unknown size to 0?

2004-01-21 Thread Charles K. Clarkson
vaishnavi krishnamurthy <[EMAIL PROTECTED]> wrote: : Can anyone tell me how I can do the following - all the : elements in my array of unknown size should be initialized : to the value 0? Assuming your array has only one dimension: @array = (0) x @array; HTH, Charles K. Clarkson -

RE: how to initialize an array of unknown size to 0?

2004-01-21 Thread chetak.sasalu
Hi Vaish, The size of your "unknown sized" array can be found using the function scalar. Here is one way to do it. #! /usr/bin/perl -w my @arrUnknownSize = (1,3,4); for(my $i=0; $i < scalar(@arrUnknownSize); $i++) #try using the condition $i <= scalar(@arrUnknownSize) and watch da fun! {$ar