I need to clear the printed values in perl console window. For an example,
Note: I am developing this in Windows OS.
use strict;
my $mode;
Initialize();
sub Initialize{
print "Enter 1 or 2";
$mode=<STDIN>;
chomp($mode);
check_mode($mode);
}
sub check_mode{
if(($mode!=1) and ($mode!=2)){
print "invalid selection";
Initialize();
}
else{
print "valid selection";
sleep 5;
}
}
While entering wrong selection, I have called the Initialize function, it is printing again. But, what I want is while calling the function it should delete already printed value in the console window and it should print again. Is it possible?
Please give your valuable suggestions.
for specific to window os and linux os