Re: [Boston.pm] merge and compare help

2007-08-27 Thread Bill Ricker
On 8/27/07, Tolkin, Steve <[EMAIL PROTECTED]> wrote: > This can be easily extended to be a general purpose match/merge program. > Suppose we call the two inputs A and B. Each ID is in one of three > possible cases, and so we want three subroutines, named e.g., just_in_a, > just_in_b, and in_both.

Re: [Boston.pm] merge and compare help

2007-08-27 Thread Tolkin, Steve
This can be easily extended to be a general purpose match/merge program. Suppose we call the two inputs A and B. Each ID is in one of three possible cases, and so we want three subroutines, named e.g., just_in_a, just_in_b, and in_both. (In the original example just_in_a would do the same thing

Re: [Boston.pm] merge and compare help

2007-08-27 Thread John Macdonald
Your solution is the right one. The final trick is to make sure you keep going with one file after the other file reaches the end. I usually have the file read routine return a fake record for EOF, that has a key guaranteed to be higher than any real key. (That requires knowing what the keys

[Boston.pm] merge and compare help

2007-08-27 Thread Alex Brelsfoard
Hi All, I'm back and with a new algorithm/solution I need help with. I have two csv files, sorted by the first column (ID). Each file may have all the same, none of the same, or some of the same ID's. I would like to take these two files, and make one out of them. Two tricks: - When I come

Re: [Boston.pm] quick XML::Twig / variable scope problem

2007-08-27 Thread Alex Brelsfoard
Thank you all very much. I think this gives me all the answers I need (and then some). I needed to move forward on this project, so for the moment I have taken the ugly route ad made the variables global. But I hope to try applying some of these better methods by the middle of the week. I will

Re: [Boston.pm] quick XML::Twig / variable scope problem

2007-08-27 Thread mirod
Alex Brelsfoard wrote: > sub main { > my $catalog_timestamp; [...] > my $catalog_settings = XML::Twig->new( > twig_handlers => { > 'Item'=> \_catalog_field_names, > 'Catalog' => \_catalog_timestamp, >