Next | Lightweight Databases | 21 |
Add record S
With a plain flat text file, there's a shortcut for adding records
Adding a record at the end of the file is very cheap
Append to beginning S Append to middle S Append to end 1
The code looks like this:
sub add_user { my ($file, $new_user_data) = @_; local *F; open F, ">>", $file or return; print F $new_user_data, "\n"; }
Next | Copyright © 2003 M. J. Dominus |