You're doing better than you think. There are a few errors that interfere with what you want.
- In query_databases(), %dbs is declared my inside the loop over databases. The ORACLE2 pass will destroy the ORACLE1 data. Solution: move my %dbs; outside the for (@DB) {} loop, and plan on an extra top level of keys in the hash labeling which db the data is from.
- Your sub does not return a useful value, so all the lexical data you've collected is being lost on exit. Return a reference to the %dbs hash by adding the last line to the sub: return \%dbs;
- When you call query_databases(), you should assign the result to a variable. That can then be passed to the do_compare() sub.
I'm not clear on exactly what you want to compare, but all the data collected in the queries is available in the return from query_databases(). Your sub will start out:
sub do_compare {
my $dbs = shift;
my $the_results;
# compare stuff and set $the_results
return $the_results;
}
I haven't examined your database queries, assuming they do what you want.
After Compline,
Zaxo
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.