Next | Lightweight Databases | 68 |
If performance is more important than immediate writing, you may disable it:
my $f_obj = tied(@FILE);
$f_obj->defer;
for (@FILE) { s/^/>> /; }
$f_obj->flush;
All writing is done in memory until you call ->flush
(Or until the memory limit you specified is exceeded.)
Then all the writing is done in one batch
tie @FILE, 'Tie::File', $myfile, dw_size => 500000;
Default: Whatever the memory limit is
Next | Copyright © 2003 M. J. Dominus |