GNUBee has asked for the wisdom of the Perl Monks concerning the following question:
loop and i can enter input and process the input fine as long as the RETURN key is pressed... but what i'd really like to do is listen for a particular character to be typed at STDIN and then call a subroutine without having pressed the RETURN key at all. for Example I'd like to listen for the character `%` in some text entered at STDIN , say for e.g. `Hello %` and without pressing the RETURN key, call a subroutine since `%` was detected. I'd really, really appreciate any input on this. I'm really new to perl and thus far it has been good learning this amazing language, but i still need some help around the tricky bends, i hope you monks can guide me and show me the path to enlightenment ;).Thanks a lot in advance.while(<STDIN>) { }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Action based on Character recieved from STDIN
by Plankton (Vicar) on Aug 30, 2004 at 21:57 UTC | |
|
Re: Action based on Character recieved from STDIN
by Prior Nacre V (Hermit) on Aug 31, 2004 at 10:42 UTC |