I am trying to automate my company's statistic gatherings. I am using Spreadsheet::Excel for this purpose. my code (i just started this a few mins ago) looks like this:
#!/usr/bin/perl use Spreadsheet::WriteExcel; my $day = (Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday)[( +localtime)[6]]; my $month = (January, February, March, April, May, June, July, August, + September, October, November, December)[(localtime)[4]]; my $date = (localtime)[3]; my $workbook = Spreadsheet::WriteExcel->new("test.xls"); my $worksheet = $workbook->addworksheet('3rd Quarter 2002'); my $format = $workbook->addformat(); $format->set_bold(); $worksheet->write(2, 0, 'Date', $format); $worksheet->write(2, 1, 'Day', $format); $worksheet->write(2, 2, 'AOL', $format); $worksheet->write(2, 3, 'MSN', $format); $worksheet->write(2, 4, 'Katrillion', $format); $worksheet->write(2, 5, 'CS', $format); $worksheet->write(2, 6, 'Daily Total', $format); $worksheet->write(2, 7, 'AOL Weekly', $format); $worksheet->write(2, 8, 'Mo. Run Total', $format); $worksheet->write(2, 9, '% change', $format); $worksheet->write(3, 0, "$month $date"); $worksheet->write(3, 1, $day);
my problem is those last 2 lines right there. i cant hardcode those values, this script is supposed to write in a different cell each day.. 3, 0 and 3, 1 are today, for example. 4, 0 and 4, 1 are tomorrow. etc help, please.

In reply to 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.