Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!male!anywhere.EBay.Sun.COM!me From: me@anywhere.EBay.Sun.COM (Wayne Thompson - IR Workstation Support SE) Newsgroups: comp.lang.perl Subject: eval problem Message-ID: <5274@male.EBay.Sun.COM> Date: 28 Feb 91 01:09:43 GMT Sender: news@male.EBay.Sun.COM Lines: 25 I'm trying to write a hyperltext (TM) engine in curseperl4.0b. A keypress references a keymap which looks something like this: $keymap[ord(' ')] = 'PageDown'; $keymap[ord('J')] = 'ScrollUp'; ... The eval routine looks like this: eval ("&$keymap[$ch]") || &bell; and each sub returns 1. sub ScrollUp { $line = &min ($line + int ($lines1 / 2), $#lines - $lines2); $curs_index = $curs_byline[$line] if $curs_lines[$curs_index] < $line; 1; } The problem is that the eval seems to happen sporadically. It appears not to call the subroutine and return undef on occasion with a valid keypress. I haven't been able to discern a pattern yet. Any thoughts? Wayne