I am trying to write a script that pulls some data out of certain columns in a spreadsheet and loads them into an array for comparing and updating. I am having trouble actually seeing the data, it keeps giving me a HASH message. the code is this:
@{$sheet->{Cells}[$row]};
my @indexes = (2 .. (2+4-1));
my @dcells = @{$sheet->{Cells}[$row]}[@indexes];
open FILE, ">>forgetyou.txt";
foreach (@dcells) {
print FILE ($_);
}
close FILE;
I wanted to print the data from the cell into a text file as a kind of test to see what columns were coming up etc. and it gives me this:
Spreadsheet::ParseExcel::Cell=HASH(0x70a49a8)Spreadsheet::ParseExcel::
+Cell=HASH(0x70a4a08)Spreadsheet::ParseExcel::Cell=HASH(0x70a4a98)
over and over, I know this is data from the hash but I dont know how to see the actual contents of the cell.
please help
ken
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.