Re: 2 dimensions array
- From: shawnhcorey@xxxxxxxxx (Shawn H Corey)
- Date: Sun, 11 Dec 2011 19:28:47 -0500
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.
.
- Follow-Ups:
- Re: 2 dimensions array
- From: kurtz le pirate
- Re: 2 dimensions array
- References:
- 2 dimensions array
- From: kurtz le pirate
- 2 dimensions array
- Prev by Date: Re: File health check on *nix system using stat
- Next by Date: LibXML error CPAN. XML::GDOME
- Previous by thread: 2 dimensions array
- Next by thread: Re: 2 dimensions array
- Index(es):
Relevant Pages
|