> Message du 06/12/08 11:40
> De : "Andy Dixon"
> A : "Perl Beginners"
> Copie à :
> Objet : Stupid question....
>
>
> Hello,
>
> I am trying to add data into a multidimensional array in a loop. I'm
> wanting something along the lines of:
>
>
> @array =
> $record[0]='foo'
> $record[1]='bar'
> $record[2]='fue'
> $record[3]='bargh'
>
> $record[0]='foo'
> $record[1]='bar'
> $record[2]='fue'
> $record[3]='bargh'
>
> $record[0]='foo'
> $record[1]='bar'
> $record[2]='fue'
> $record[3]='bargh'
>
> However, coming from a PHP background, things are somewhat different.
> I dont seem to be able to get my head around it...!
>


Don't know what you wanted exactly.
Given you have this array:

@record = ('foo','bar','fue','bargh');
if you want to creat another array from it like this:

@array = ( [foo','bar','fue','bargh'],
                 [foo','bar','fue','bargh'],
                 [foo','bar','fue','bargh']);

you can do:

@array = ([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]);

or,

push @array,[EMAIL PROTECTED] for 1 .. 3;
       
--
Jeff Pang
http://home.arcor.de/pangj/

 Créez votre adresse électronique [EMAIL PROTECTED] 
 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.

Reply via email to