Perl recipe for turning lines of numbers into an array?
- From: "Sina Bahram" <sbahram@xxxxxxxxx>
- To: <programmingblind@xxxxxxxxxxxxx>
- Date: Tue, 24 Feb 2009 13:35:36 -0500
Hi all,
I've got the following data, which I know will always be 14 rows long and 14
columns wide. The data is floating point numbers, the columns are separated
by spaces, and the rows are separated by new lines ... Here's a 3 by 3
example of the 14 by 14 data.
298.25 1.2 -4
-194 1.239 -0.051
1.2 -253.221 100.24
How can I turn that into an array with indicies 0 through 2 which each have
0 through 2 cells?
In other words a two dimensional 3x3 array with 9 elements?
Keep in mind numbers can be positive, negative, and can have decimals.
If we have this in $matrix, how can we turn it into an array?
Thanks
Take care,
Sina
__________
View the list's information and change your settings at
http://www.freelists.org/list/programmingblind
Other related posts: