I posted a earlier Q about having problems using Spreadsheet::WriteExcel to insert data from global lists that are declared as arrays i can only get the the first list data into the spreadsheet the rest of the lists that contain data are not being put into the spreadsheet this is the code iam trying to get working
sub populateExcelRows { my $workbook = Spreadsheet::WriteExcel->new("test.xls"); my $worksheet = $workbook->add_worksheet(); my $j = 1; #Declare Headings for row 0 and the 6 Columns $worksheet->write(0,0 , 'Equipment Model'); $worksheet->write(0,1, 'Devices Per Model'); $worksheet->write(0,2, 'Devices Per Variant'); $worksheet->write(0,3, 'Model Variant Processor'); $worksheet->write(0,4 , 'Device Memory'); $worksheet->write(0,5 , 'Device Software'); #Loop through Global Array called Models to determine the number of + rows to place data for ($j = 1; $j <= $#model; $j++) { print "row is $rowCounter, $model[$j], $devicesPerVari +ant[$j], $processor[$j], $memory[$j], $softwareVersion[$j]\n"; $worksheet->write($rowCounter,0, $model[$j]); if ($j == 0) { $worksheet->write($rowCounter,1, $devicePerMod +el); } $worksheet->write($rowCounter,2, $devicesPerVariant[$j +]); $worksheet->write($rowCounter,3, $processor[$j]); $worksheet->write($rowCounter,4, $memory[$j]); $worksheet->write($rowCounter,5, $softwareVersion[$j]) +; $rowCounter++; } $workbook->close();
iam at a loss what to do? here is the lists as seen by a for loop "row is 1 ..." is the only one that is seen in the spreadsheet  row is 1, GSR, 2, GRP, 256Mb, 12.0(26)S3
the rest do not appear  row is 2, 6503, 13, WS-X6K-SUP2-2GE, 128Mb, 7.6(8)
 row is 3, 6503, 10, WS-X6K-SUP2-2GE, 256Mb, 7.6(8)
..there is more of the above lines there should be up to 35 rows that should be populated in the spreadsheet

Edited by Chady -- fixed code tags.


In reply to Spreadsheet::WriteExcel Loop problem by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.