i would suggest that another CTRL-C would terminate the program as i
think that's more common practice, but anyway -
if you want to decide if the user entered 3 empty lines (or
CRs) or a single character 'q' you'd have to use Term::ReadKey and maybe Term::ReadLine.