Index


NAME

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

VERSION

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

SYNOPSIS

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

    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::Row::Join 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 Tie::FieldVals and Tie::FieldVals::Selection for explanations of the other arguments.

FETCH

Get a row from the array.

    $val = $array[$ind];

Returns a reference to a Tie::FieldVals::Row::Join 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::Row::Join
    Tie::FieldVals::Select

SEE ALSO

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

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