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

I believe the OP wanted effectively to list the files in a directory, get the count of the number of files, and save this number in a file. Per my recommended approach (Tie::File), each line in the store file would contain an integer of the number of files. This file would have eight lines (one per hour apparently). After the file hits eight lines, the top one (oldest) gets shifted off, and the most recent goes to the bottom.