Next Lightweight Databases 31

Overwriting Records





        sub uppercase_username {
          my ($fh, $username) = @_;
          seek $fh, 0, SEEK_SET;
          while (<$fh>) {
            my ($u, $rest) = split /:/, $_, 2;
            next unless $u eq $username;
            seek $fh, -length($_), SEEK_CUR;
            print $fh uc($u);
            return;
          }
        }


Next Copyright © 2003 M. J. Dominus