I have a database that is in excel, to read it into perl and do calulations with it based on user input, I export it into text, save as .txt and read it in into Perl.
I would get the script to work directly from excel and skip the conversion to text.
I can get it to read directly from Excel with OLE, but the calculations do not work eg:
lets say that the excel file contains the following data and the resulting 2d array is @lol,
A B
1 10 1
2 10 2
This prints outs correctly with loops but the following does does not work:
$sum=$lol[0][0]+$lol[0][1];
print "$sum"; #prints 0
$length_of_lol= scalar (@lol);
print "$length_of_lol"; #prints 0
Can anyone point out whats wrong?
thanks
Ratz
I would get the script to work directly from excel and skip the conversion to text.
I can get it to read directly from Excel with OLE, but the calculations do not work eg:
lets say that the excel file contains the following data and the resulting 2d array is @lol,
A B
1 10 1
2 10 2
This prints outs correctly with loops but the following does does not work:
$sum=$lol[0][0]+$lol[0][1];
print "$sum"; #prints 0
$length_of_lol= scalar (@lol);
print "$length_of_lol"; #prints 0
Can anyone point out whats wrong?
thanks
Ratz