Answer:
see explaination 
Step-by-step explanation:
SIG{INT} = sub {
 `mv unprocessed.txt processed.txt`;
 print "\\";
 exit;
 };
`ps aux > unprocessed.txt`;
print "Press 'q' to exit or 'ctrl-c' to process the file and exit:\\";
$inp = <>;
if ($inp == 'q')
{
 exit;
}