On 11-12-11 06:57 AM, kurtz le pirate wrote:

Hello,

I want to have a two dim array. I build it like this:

   my @Cylinders;


   /.*(<.*>),(<.*>).*/;
   push @{$Cylinders[0]}, $1;
   push @{$Cylinders[1]}, $2;


Seems to work but a get an array with '2' lines and 'n' columns
instead of 'n' lines with '2' columns'.


display array with 'print Dumper \@Cylinders;' confirm this.

where is my mistake ?



thank if you can help me.


Try:

push @Cylinders, [ $1, $2 ];

This will put the two captured variables in an anonymous array and push it onto @Cylinders.


--
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

Never give up your dreams.  Give up your goals, plans,
strategy, tactics, and anything that's not working but never
give up your dreams.

--
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