Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Tie::FieldVals::Join
an array tie for two files of FieldVals data

Tie::FieldVals::Join - an array tie for two files of FieldVals data


NAME

Tie::FieldVals::Join - an array tie for two files of FieldVals data


VERSION

This describes version 0.40 of Tie::FieldVals::Join.


SYNOPSIS


    use Tie::FieldVals;

    use Tie::FieldVals::Row;

    use Tie::FieldVals::Join;

    use Tie::FieldVals::Join::Row;

    my @records;

    my $recs_obj = tie @records, 'Tie::FieldVals::Join',

        datafile=>$datafile, joinfile=>$joinfile,

        join_field=>$fieldname, selection=>{$key=>$value};


DESCRIPTION

This is a Tie object to map the records in two FieldVals data files into an array.

This depends on the Tie::FieldVals::Join::Row module.


OBJECT METHODS

field_names

Get the field names of this data.

my @field_names = $recs_obj->field_names();


Tie-Array METHODS

TIEARRAY

Create a new instance of the object as tied to an array. This is a read-only array.


    tie %person, 'Tie::FieldVals::Join', datafile=>$datafile,

        joinfile=>$joinfile, join_field=>$fieldname,

        selection=>{$key=>$value...}, match_any=>$val2;

    tie %person, 'Tie::FieldVals::Join', datafile=>$datafile,

        joinfile=>$joinfile, join_field=>$fieldname,

        cache_size=>1000, memory=>0;

    tie %person, 'Tie::FieldVals::Join', datafile=>$datafile,

        joinfile=>$joinfile, join_field=>$fieldname,

        selection=>{$key=>$value...}, match_any=>$val2,

        cache_all=>1;

The datafile option is the first file, the joinfile is the second. The join_field is the field which the two files have in common, upon which they are joining. Only rows where both files have the same value for the join_field will be put in this join.

Note that is a very naieve join algorithm: it expects the datafile file to have unique values for the join_field, and the joinfile file to have multiple values for the join_field -- if the order is the other way around, the results will be messed up.

The join array is read-only.

See the Tie::FieldVals manpage and the Tie::FieldVals::Selection manpage for explanations of the other arguments.

FETCH

Get a row from the array.


    $val = $array[$ind];

Returns a reference to a Tie::FieldVals::Join::Row hash, or undef.

STORE

Add a value to the array. Does nothing -- this is read-only.

FETCHSIZE

Get the size of the array.

STORESIZE

Does nothing.

EXISTS


    exists $array[$ind];

DELETE


    delete $array[$ind];

Does nothing -- this array is read-only.

CLEAR


    @array = ();

Does nothing -- this array is read-only.

UNTIE


    untie @array;

Untie the array.


PRIVATE METHODS

For developer reference only.

debug

Set debugging on.

whowasi

For debugging: say who called this


REQUIRES


    Test::More

    Carp

    Data::Dumper

    Tie::Array

    Fcntl

    Tie::FieldVals

    Tie::FieldVals::Row

    Tie::FieldVals::Join::Row

    Tie::FieldVals::Select


SEE ALSO

perl(1). the Tie::FieldVals manpage the Tie::FieldVals::Row manpage the Tie::FieldVals::Select manpage the Tie::FieldVals::Join::Row manpage


BUGS

Please report any bugs or feature requests to the author.


AUTHOR


    Kathryn Andersen (RUBYKAT)

    perlkat AT katspace dot com

    http://www.katspace.com


COPYRIGHT AND LICENCE

Copyright (c) 2004 by Kathryn Andersen

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy