in reply to Re^3: Rolling variable
in thread Rolling variable
This does not solve the prerequisite that the OP needs to access the list of file counts from an external source in between runs.
Also, there's no reason to have to use so many arrays and trickery. The following will remove the oldest addition after the array reaches a length of eight, and add a new one to the bottom of the list:
my @a = qw(1 2 3 4 5); for (1..5){ shift @a if @a == 8; push @a, 'new data'; } print "$_\n" for @a;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Rolling variable
by james28909 (Deacon) on Jul 30, 2015 at 15:09 UTC | |
by fishmonger (Chaplain) on Jul 30, 2015 at 15:15 UTC | |
by james28909 (Deacon) on Jul 30, 2015 at 15:36 UTC | |
by fishmonger (Chaplain) on Jul 30, 2015 at 16:00 UTC | |
by james28909 (Deacon) on Jul 30, 2015 at 17:40 UTC | |
|