+ my @args = ();
+ if ( !$error && $opt{'args_callback'} ) {
+ @args = &{ $opt{'args_callback'} }( $cgi, $new );
+ }
+
+ if ( !$error && $opt{'debug'} ) {
+ warn "$me updating record in $table table using $class class\n";
+ warn Dumper(\%hash);
+ warn "with args: \n". Dumper(\@args) if @args;
+ }
+
+ if ( !$error ) {
+ if ( $old_pkey ) {
+ $error = $new->replace($old, @args);
+ } else {
+ $error = $new->insert(@args);
+ }
+ $new_pkey = $new->getfield($pkey);
+ }