Next | Lightweight Databases | 70 |
Read-only mode:
use Fcntl 'O_RDONLY'; tie @FILE, 'Tie::File', $myfile, mode => O_RDONLY;
Change the record separator string:
tie @FILE, 'Tie::File', $myfile, recsep => ";;";
Tie an open filehandle:
tie @FILE, 'Tie::File', \*STDIN, mode => O_RDONLY;
Lock the file:
use Fcntl ':flock'; (tied @FILE)->flock(LOCK_EX);
(Locking is another advantage over DB_File)
Next | Copyright © 2003 M. J. Dominus |