Perl: Signals and Threads. How to kill thread with qx() inside
===

i have a script, that parse log and find errors and warnings.  
And i want to use user-friendly interpretation of this log.  
For this reason, i use `notepad`.  
Here is code:  

    use v5.16;
    use strict;
    use warnings;
    
    use Win32::Clipboard;
    use threads;
    use utf8;
    
    my $kp = Win32::Clipboard->new();
    
    my $output = shift || "out_log.txt";
    
    #my ($input, $output)=@ARGV;
    #open my $ih, "<", $input or die "can't open input file with log\n";
    
    open my $oh, ">", $output or die "can't open output file with log\n";
    my @alls=split /\n/,$kp->Get();
    
    for my $k(0..$#alls){
    	$_ = $alls[$k];
    	if(/^ERR.+|^WARN.+/){
    		print {$oh} qq(at position $k --> ).$_."\n";
    		}
    	}
    my $thread = 
    threads->create(sub{
    				$SIG{INT}=sub{die"All good\n";};
    				qx(notepad $output);
    			}
    		);
    
    print qq(type 'y' for quit);
    do{
    	print "want to quit?\n>" ;
    	chomp;
    	do{
    		say "I will kill this thread";
    		$thread->kill('INT') if defined($thread);		
    		say "and delete output";
    		unlink $output;
    		exit(0);
    		}if (m/y/);
    	}while(<>);

It falls down, when i trying to kill thread which run notepad.  
How to do this, using signals and threads? Is it possible?  
And your ideas about solution, please.  
Thanks!