in reply to Re: Translating Terminal Input Code from Bash to Perl
in thread Translating Bash to Perl

When I try this,
#!/usr/bin/perl $key=`read -n3 key; echo \$key`; print "$key\n";
I get this error...
read: 1: Illegal option -n

Replies are listed 'Best First'.
Re^3: Translating Terminal Input Code from Bash to Perl
by jakobi (Pilgrim) on Sep 30, 2009 at 20:57 UTC
    Don't expect portability from shell builtins across multiple versions or multiple shells. Try w/o the -n3, but then you always need to press CR.