errore risolto
così:
codice:
...
if($c=~/[iI]/){print "Ciao";}
  if($c=~/[rR]/){print "Pippo";}
  if($c=~/[uU]/){exit(0);}
}