Dear monkers, I need a permanent prompt to listen for user commands. The code I'm currently using is the following:
sub promptUser {
local($promptString,$defaultValue) = @_;
print $promptString;
$| = 1;
$_ = <STDIN>;
chomp;
return $_;
}
while (1) {
$command = &promptUser("ABC> ");
}
The above code works perfect, and store what user write into $command variable. The problem is that in this prompt, Backspace and arrows doesn't work. I got something like:
^H^[[A^[[B . So for delete chars I have to use canc, but I cannot use arrows to move into what I wrote or UP and DOWN to surf into history like bash already do.
Is there a way to use backspace and/or arrows without external module? (I'm in a server offline)
Thank you Lucas