in reply to update a txt file
use Tie::File; { tie my @array, 'Tie::File', 'filename' or die "eek $@ $! $/"; push @array, scalar localtime; unshift @array, scalar gmtime; } warn "and the file contains $/"; { tie my @array, 'Tie::File', 'filename' or die "eek $@ $! $/"; print $_,$/ for @array; } __END__ $$ perl test and the file contains Sun Mar 14 01:19:12 2004 Sat Mar 13 17:19:12 2004 $$ perl test and the file contains Sun Mar 14 01:19:14 2004 Sun Mar 14 01:19:12 2004 Sat Mar 13 17:19:12 2004 Sat Mar 13 17:19:14 2004 $$ perl test and the file contains Sun Mar 14 01:19:15 2004 Sun Mar 14 01:19:14 2004 Sun Mar 14 01:19:12 2004 Sat Mar 13 17:19:12 2004 Sat Mar 13 17:19:14 2004 Sat Mar 13 17:19:15 2004
|
|---|