|
PTools::SDF::ARRAY - Load array of 'IFS delimited fields' into PTools::SDF::SDF object |
PTools::SDF::ARRAY - Load array of 'IFS delimited fields' into PTools::SDF::SDF object
This document describes version 0.08, released March, 2005.
use PTools::SDF::SDF qw( noparse ); # Optional performance boost.
use PTools::SDF::ARRAY;
By default the PTools::SDF::SDF Class (from which this class inherits) will parse each field separately looking for an encoded delimiter character. Often this is unnecessary. Since the overhead is high, disable this parsing prior to 'using' this package as shown above.
$sdfRef = new PTools::SDF::ARRAY( $arrayRef );
or $sdfRef = new PTools::SDF::ARRAY;
$sdfRef->loadFile( $arrayRef );
Usage is identical to both PTools::SDF::SDF and, optionally, PTools::SDF::IDX except that, as shown above, the objects load from an array reference instead of from a data file. The array reference is expected to be a list of 'records' delimited with a field separator. For example,
open(IN,'</etc/passwd') or die $!;
(@array) = <IN>;
$arrayRef = \@array;
close(IN);
None. This class relies on a parent class for the constructor method.
No additional public methods are defined here. A couple of private methods are overridden to facilitate loading data from an array.
This PTools::SDF::ARRAY class inherits from the PTools::SDF::SDF class. Additional methods are available via this and other parent classes.
See the PTools::SDF::Overview manpage, the PTools::SDF::CSV manpage, the PTools::SDF::DB manpage, the PTools::SDF::DIR manpage, the PTools::SDF::DSET manpage, the PTools::SDF::File manpage, the PTools::SDF::IDX manpage, the PTools::SDF::INI manpage, the PTools::SDF::SDF manpage, the PTools::SDF::TAG manpage the PTools::SDF::Lock::Advisory manpage, the PTools::SDF::Sort::Bubble manpage, the PTools::SDF::Sort::Quick manpage, the PTools::SDF::Sort::Random manpage and the PTools::SDF::Sort::Shell manpage.
In addition, several implementation examples are available. See the PTools::SDF::File::AutoHome manpage, the PTools::SDF::File::Mnttab manpage and the PTools::SDF::File::Passwd manpage. These can be found in the 'PTools-SDF-File-Cmd' distribution on CPAN.
Chris Cobb, <nospamplease@ccobb.net>
Copyright (c) 1997-2007 by Chris Cobb. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
PTools::SDF::ARRAY - Load array of 'IFS delimited fields' into PTools::SDF::SDF object |