in reply to Db table to non-alike db table copying

Alternatively, at risk of pimping my own module, Data::Sync is designed to do this sort of operation. Here's an example:

my $h=Data::Sync->new(); $h->source($sourcedbihandle,"select * from source"); $h->target($targetdbihandle,{index=>"MYPRIMKEY", hashattributes=>[field1,field2]}); $h->mappings(field1=>'targetfield1',field2=>'targetfield2'); $h->transforms(targetfield1=>"s/(\w)+\s(\w+)/$2 $1/", targetfield2=>"lowercase"); $h->run;
That would:
read from $sourcedbihandle all records that match the query
Remap the source field names to the target field names
Transform the data in field1 with the regex, and field2 lowercase
Write all records that have changed since the last run.

Deletion isn't supported in v0.06 (on CPAN), but the next version has deletion support; I'm currently trying to up the test coverage, but if you want to /msg me I can send you an early copy.

Update: Just to clarify - writing only records that have changed since the last run is based on hashing a list of attributes. The 'hashattributes' parameter to target() contains a list of the attributes you want to hash.

--------------------------------------------------------------

"If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."
John Brunner, "The Shockwave Rider".