Next | Lightweight Databases | 12 |
For casual tasks, -i is very handy
But if Perl crashes or the system goes down in the middle, the data is lost
Even if Perl doesn't crash, the file is in an inconsistent state while it's being rewritten
Hair-raising example:
perl -i.bak -F: -lane 'print unless $F[0] eq "billg"' /etc/passwd
Suppose perl gets swapped out just after it renames /etc/passwd
Now the password file is empty
Anyone can log in with no password
We need a more reliable strategy
Next | Copyright © 2003 M. J. Dominus |