Chris Cobb > PTools-SDF-0.01 > PTools::SDF::ARRAY

Download:
PTools-SDF-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.09   Source  

NAME ^

PTools::SDF::ARRAY - Load array of 'IFS delimited fields' into PTools::SDF::SDF object

VERSION ^

This document describes version 0.08, released March, 2005.

SYNOPSIS ^

        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);

DESCRIPTION ^

Constructor

None. This class relies on a parent class for the constructor method.

Methods

No additional public methods are defined here. A couple of private methods are overridden to facilitate loading data from an array.

INHERITANCE ^

This PTools::SDF::ARRAY class inherits from the PTools::SDF::SDF class. Additional methods are available via this and other parent classes.

SEE ALSO ^

See PTools::SDF::Overview, PTools::SDF::CSV, PTools::SDF::DB, PTools::SDF::DIR, PTools::SDF::DSET, PTools::SDF::File, PTools::SDF::IDX, PTools::SDF::INI, PTools::SDF::SDF, PTools::SDF::TAG PTools::SDF::Lock::Advisory, PTools::SDF::Sort::Bubble, PTools::SDF::Sort::Quick, PTools::SDF::Sort::Random and PTools::SDF::Sort::Shell.

In addition, several implementation examples are available. See PTools::SDF::File::AutoHome, PTools::SDF::File::Mnttab and PTools::SDF::File::Passwd. These can be found in the 'PTools-SDF-File-Cmd' distribution on CPAN.

AUTHOR ^

Chris Cobb, <nospamplease@ccobb.net>

COPYRIGHT ^

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.