Help for this page

Select Code to Download


  1. or download this
    my $last_pos = 0;               # start at the beginning
    # later....
    seek(FILE, $last_pos);          # go to where I was
    ...
         if (/$userid/) {           # sure about the /o, BTW?
            $last_pos = tell(FILE); # remember this spot
            ....                    # other stuff
    
  2. or download this
    my %index;
    while (<FILE>) {
    ...
    seek(FILE, $index{$userid});
    $_ = <FILE>;
    ($inv, $date, $amt) = split (...);