in reply to Re^2: Rolling variable
in thread Rolling variable
If you dont undef @files then it will keep a list of the filenames. You can comment it out to see if you need to undef it or not. To me though, if you have already did operations on the files in @files, then there is no need to save a list.use strict; use warnings; my @file_array = qw(file1 file2 file3 file4 file5 file6 file7 file8 fi +le9); my @reversed_file_array = reverse @file_array; my @files; while (1) { for ( 0 .. 7 ) { push @files, $reversed_file_array[$_]; } print "$_\n" for @files; undef @file_array; undef @files; sleep 2; #or sleep 3600 for 1 hour }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Rolling variable
by stevieb (Canon) on Jul 30, 2015 at 14:37 UTC | |
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 | |
|