This is one of many times similar homework type questions have been asked, without providing any proof whatsoever of an attempt of any kind. Perlmonks are being too generous in offering code, so that Derpp will never get past break in stage into perl. This forum is not a free homework service.
the hardest line to type correctly is: stty erase ^H