Help for this page

Select Code to Download


  1. or download this
    open (RECORD_NUMBER, "counter_data.dat") or die;
    
  2. or download this
    $count = <RECORD_NUMBER>;
    
  3. or download this
    $count = $count + 1;
    
  4. or download this
    print RECORD_NUMBER "$count";
    
  5. or download this
    close (RECORD_NUMBER) or die;
    
  6. or download this
    open (RECORD_NUMBER, '+<', "counter_data.dat") or die;
    chomp($count = <RECORD_NUMBER>);
    ...
    seek RECORD_NUMBER, 0, 0;
    print RECORD_NUMBER $count,"\n";
    close (RECORD_NUMBER) or die "Canīt close filehandle RECORD_NUMBER: $!
    +\n";