I still have to press ENTER key for the input to stop after the 3 characters. For example,#!/usr/bin/perl use Term::ReadKey; use strict; my $c=""; do{$c.=ReadKey(0); last if $c=~/[\x0a]/} for 1..3; print "$c\n";
$# 12345 <ENTER KEY> 123
In reply to Re^2: Translating Terminal Input Code from Bash to Perl
by Anonymous Monk
in thread Translating Bash to Perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |