in reply to Re: Translating Terminal Input Code from Bash to Perl
in thread Translating Bash to Perl
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Translating Terminal Input Code from Bash to Perl
by jakobi (Pilgrim) on Sep 30, 2009 at 22:18 UTC |