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

its a daily script. each day it'll write to a new cell, with current day's data
  • Comment on Re: Re: Need help with a loop (i think)

Replies are listed 'Best First'.
Re: Re: Re: Need help with a loop (i think)
by waswas-fng (Curate) on Aug 20, 2002 at 15:28 UTC
    Here is some code to show what you could do, I have split it out into a lot of lines so it will be easier for you to read...
    open (CELLNUM, "/usr/local/share/dailystats/.cellnum") or die "Cant op +en Cell num file: $!\n"; open (CELLNUM2, ">/usr/local/share/dailystats/.cellnum") or die "Cant +open Cell num file: $!\n"; $cellnum = <CELLNUM>; $cellnum++ print CELNUM2 "$cellnum"; close CELNUM; close CELNUM2;
    Then use $celnum in place of "3" in your orig script.. You will want to refine this approach but you get the idea.

    -Waswas
Re: Re: Re: Need help with a loop (i think)
by Mr. Muskrat (Canon) on Aug 20, 2002 at 21:51 UTC
    You do realize that Spreadsheet::WriteExcel creates a new spreadsheet. It cannot append data to an already existing spreadsheet. You have to add that functionality yourself.
Re: Re: Re: Need help with a loop (i think)
by reyjrar (Hermit) on Aug 20, 2002 at 16:27 UTC
    Is there some limit to the number or is the cell num going to go on forever ? Even if this is just a personal project that's not going to really break anything if it breaks, you might want to use it as an opportunity to think about "what if its still runnning a year from now? Are the 365 cells overkill?" That kinda stuff and try to come up with a nifty idea to manage that amount of data.

    -brad..