in reply to Unexpected deletion of data using > operator
my @customerarray = ( ... ); my $now = time; my @keep = grep { my ($timestamp) = (split '::', $_)[2]; $now - $timestamp <= 15*24*60*60 # items less than 15 days old } @customerarray; open FH, '>', "$cuslist.tmp" or die "Can't open $cuslist.tmp: $!"; print FH "$_\n" for @keep; close FH;
open FH, '>', "$cuslist.tmp" or die "Can't open $cuslist.tmp: $!"; print FH "$_\n" for grep { time - split '::', $_)[2] <= 15*24*60*60 } +@customerarray; close FH;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unexpected deletion of data using > operator
by jonnyfolk (Vicar) on Dec 07, 2008 at 19:41 UTC |