Tie::Array::CSV::HoldRow - A Tie::Array::CSV subclass for deferring row operations
use strict; use warnings; use Tie::Array::CSV::HoldRow; tie my @file, 'Tie::Array::CSV::HoldRow', 'filename'; print $file; $file = "Camel";
This module is an experimental subclass of Tie::Array::CSV, see usage information in that documentation.
While the usage is the same, the timing of the file IO is different. As opposed to the base module, the file is not updated while the reference to the row is still in scope. Note that for both modules, the parsed row is still held in memory while the row is in scope, the ONLY difference is that the file reflects changes immediately when
hold_row is false. To reiterate, this option only affects file IO, not memory usage.
When multiple rows are kept alive/removed/modified there was the possibility that conflicting directives could be given to a single physical line. To combat this possibility, as of version 0.05, all (living) child row objects are made aware of line number changes in the parent (outer array) should these occur. Futher if a row object is alive, but the parent object removes that line, the row object is remains intact, but the links between the row object and parent/file are severed.
Joel Berger, <firstname.lastname@example.org>
COPYRIGHT AND LICENSE
Copyright (C) 2012 by Joel Berger
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.