<div id="RTEContent">Pete and Steve,<br>  <br>  Thank you for the very instructive responses.&nbsp; I appreciate it.<br>  <br>  Have a Happy New Year.<br>  <br>  Richard<br><br><b><i>Pete Krawczyk &lt;mongers@bsod.net&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">  Subject: [Chicago-talk] how to recreate keystoke lost in cbreak?<br>From: Richard Reina <richard @rushlogistics.com=""><br>Date: Wed, 28 Dec 2005 05:24:27 -0800 (PST)<br><br>}It works as intedended except for one important defect.  The first<br>}keystroke that triggers the else gets lost.<br><br>First of all, please send code that compiles and runs to the list when <br>you're having problems.  The module is Term::ReadKey, not Term::Readkey, <br>and it implements a ReadKey function, not ReadkKey.<br><br>That said, your problem is in your control structure.<br><br>  unless (my $a = sub()) {<br> # $a is in scope here<br> do_stuff();<br> # $a
 falls out of scope here<br>  } else {<br>        # $a is not in scope here<br>  }<br><br>So really, your code has two options:  Move the 'my $key' above the <br>unless statement, or make it an if statement and reverse your blocks of <br>code.<br><br>-Pete K<br>-- <br>Pete Krawczyk<br>  mongers at bsod dot net<br><br>_______________________________________________<br>Chicago-talk mailing list<br>Chicago-talk@pm.org<br>http://mail.pm.org/mailman/listinfo/chicago-talk<br></richard></blockquote><br></div><BR><BR>A people that values its privileges above its principles soon loses both.<br> -Dwight D. Eisenhower.