#!/usr/bin/perl $BSD_STYLE = 1; if ($BSD_STYLE) { system "stty cbreak /dev/tty 2>&1"; } else { system "stty", '-icanon', 'eol', "\001"; } my $in = ''; while (($key = getc(STDIN)) ne "\n") { $in .= $key; print "\x08 \x08"; } if ($BSD_STYLE) { system "stty -cbreak /dev/tty 2>&1"; } else { system "stty", 'icanon', 'eol', '^@'; # ASCII null } print "$in\n";