in reply to Re^4: Rolling variable
in thread Rolling variable

Thanks, i will def keep that in mind. Honestly all i was trying to do was give some ideas. I didnt see anyone else post yet and was just giving ideas.
EDIT: Also, the list of files could easily be written to a static spot in the file system.

Replies are listed 'Best First'.
Re^6: Rolling variable
by fishmonger (Chaplain) on Jul 30, 2015 at 15:15 UTC

    The OP did not say he needed to keep a list of files. The OP stated that the count of files is all that was wanted.

      I would like to keep only the last 8 counts, meaning throw away the oldest data & just keep the last 8 records.

      This could honestly be open to interpretation. I took it as what he really needed was the last 8 records thats currently in the directory. Anyways, Thanks for pointing that out, I retract any and all suggestions.

      EDIT: Hi James, Rata, Thanks for the inputs. However, I thin k this will work in a single run of the script

      Even the OP stated this would work, but he needed it to run every hour, so I modified it somewhat to show him another way. I am only giving suggestions/opinions/options in hopes it will make him think/tinker more and figure it out on his own. I also search for code and modify it as I need IF I cant figure it out myself.

        You left out a key portion of that quote.

        (please correct me if I'm wrong)

        The OP's assumption was wrong and your update should have included the correction.

        You also skipped over his last sentence.
        So I was thinking to save the counts in a file

        And why copy the array resulting in 3 arrays only differing in the order of the elements? Only 1 array is needed. The others IMO just add unnecessary obfuscation and inefficiency.