i figured it out. i did my $dayofmonth = (localtime)3; my $row = $dayofmonth; so august 20th would be in 21st row. august 21st would be in 22nd row. as of now script looks like this:
#!/usr/bin/perl use Spreadsheet::WriteExcel; my $weekday = (Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturda +y)[(localtime)[6]]; my $dayofmonth = (localtime)[3]; my $month = (January, February, March, April, May, June, July, August, + September, October, November, December)[(localtime)[4]]; my $date = (localtime)[3]; my $column = (localtime)[6] + 1; my $row = $dayofmonth; print $tmpday; my $workbook = Spreadsheet::WriteExcel->new("test.xls"); my $worksheet = $workbook->addworksheet('3rd Quarter 2002'); my $format = $workbook->addformat(); $format->set_bold(); $worksheet->write(0, 0, 'Date', $format); $worksheet->write(0, 1, 'Day', $format); $worksheet->write(0, 2, 'AOL', $format); $worksheet->write(0, 3, 'MSN', $format); $worksheet->write(0, 4, 'Katrillion', $format); $worksheet->write(0, 5, 'CS', $format); $worksheet->write(0, 6, 'Daily Total', $format); $worksheet->write(0, 7, 'AOL Weekly', $format); $worksheet->write(0, 8, 'Mo. Run Total', $format); $worksheet->write(0, 9, '% change', $format); $worksheet->write($row, 0, "$month $date"); $worksheet->write($row, 1, $weekday);

In reply to Re: Need help with a loop (i think) by vxp
in thread Need help with a loop (i think) by vxp

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.