use DBI; my $pgh=DBI->connect("DSN for Postgres here"); my $orh=DBI->connect("DSN for Oracle here"); #set up statments into variables for both eval{ my $psh=$pgh->prepare($write_stmt); my $osh=$orh->prepare($read_stmt); $osh->execute( variable list here ); $osh->bind_columns( \( $f1, $f2, $f3, ... ) ); while($osh->fetch) { $psh->execute( $f1, $f2, $f3, ... ); } $pgh->commit; } if($@) # error handler goes here { $pgh->rollback; print STDERR "Problem saving data\n"; }