Tie::FieldVals::Join - an array tie for two files of FieldVals data
This describes version 0.6202 of Tie::FieldVals::Join.
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};
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.
Get the field names of this data.
my @field_names = $recs_obj->field_names();
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.
Get a row from the array.
$val = $array[$ind];
Returns a reference to a Tie::FieldVals::Row::Join hash, or undef.
Add a value to the array. Does nothing -- this is read-only.
Get the size of the array.
Does nothing.
exists $array[$ind];
delete $array[$ind];
Does nothing -- this array is read-only.
@array = ();
untie @array;
Untie the array.
For developer reference only.
Set debugging on.
For debugging: say who called this
Test::More Carp Data::Dumper Tie::Array Fcntl Tie::FieldVals Tie::FieldVals::Row Tie::FieldVals::Row::Join Tie::FieldVals::Select
perl(1). Tie::FieldVals Tie::FieldVals::Row Tie::FieldVals::Select Tie::FieldVals::Row::Join
Please report any bugs or feature requests to the author.
Kathryn Andersen (RUBYKAT) perlkat AT katspace dot com http://www.katspace.com
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.
To install Tie::FieldVals, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tie::FieldVals
CPAN shell
perl -MCPAN -e shell install Tie::FieldVals
For more information on module installation, please visit the detailed CPAN module installation guide.