$new_log = new Log(filename => 'new.log'); $cur_log = $self->{log}; $self->{log} = $new_log; Process::spawn(\&do_task, $self); # This runs in background. $self->{log} = $cur_log; # Restore.