in reply to best way to keep a simple count?
oropen I, "<counter.txt"; my $n = <I>; chomp($n); close(I); $n++; open O +, ">counter.txt"; print O $n; close(O);
or using File::SlurpStorable::nstore("file", \$count);
perl -MFile::Slurp -le 'write_file "tmp42", $n = 1 + eval{read_file "t +mp42"}; print $n'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: best way to keep a simple count?
by brian_d_foy (Abbot) on Apr 11, 2005 at 21:27 UTC |