sub kill_process{ do { print"Kill processes for the user (y orn?\n"; my $ans = <>; chomp $ans; print "choose pid: "\n; my $pid =<>; chomp $pid; system `kill $pid`; print "process killed \n"; }while ($ans eq "Y" || $ans eq "y"); },