Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: best way to keep a simple count?

by monkfan (Curate)
on Apr 11, 2005 at 12:44 UTC ( [id://446582]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    open I, "<counter.txt"; my $n = <I>; chomp($n); close(I); $n++; open O
    +, ">counter.txt"; print O $n; close(O);
    
  2. or download this
    Storable::nstore("file", \$count);
    
  3. or download this
    perl -MFile::Slurp -le 'write_file "tmp42", $n = 1 + eval{read_file "t
    +mp42"}; print $n'
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://446582]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-26 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found