Moron has asked for the wisdom of the Perl Monks concerning the following question:
The problem: Data::Dumper reveals at this point that in %ilb none of the abs subvalues are true. Unfortunately the obvious double loop to look for an intersection between the two sets of keys DOES find them at the same point in the code. The data returning from SQL is an irrelevant id followed by a relevant number followed by a relevant id separated by tabs - my own version uses the real SQL but if you are testing to see the problem you;d have to use test data. Any ideas what did I do wrong?my (%abs, %ilb); for my $lc ( Sql ( 'select blah blah1 - but just put a list of test va +lues will do' ) ) { my ( $ln, $pos, $key ) = split /\t/, $lc; $abs{ $key } = {}; # just want a hash reference for now } for my $lc ( Sql ( 'select blah blah2 - for testing: test values that +have an intersection with the first set' ) ) { my ( $ln, $pos, $key ) = split /\t/, $lc; $ilb{ $key } = { pos => $pos, abs => defined( $abs{ $key } ) }; # +this hash is about to get used immediately in the unwritten code to f +ollow }
Update: Just one unusual factor to throw in detected so far - the perl version is v5.005__3
TIA, ^M
^M Free your mind!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: putting the return value from defined for one hash as the value in another
by Limbic~Region (Chancellor) on Apr 18, 2007 at 21:31 UTC | |
by Moron (Curate) on Apr 18, 2007 at 21:35 UTC | |
|
Re: putting the return value from defined for one hash as the value in another
by roboticus (Chancellor) on Apr 19, 2007 at 11:50 UTC | |
by Moron (Curate) on Apr 19, 2007 at 12:38 UTC |