Menu system with vgetty

Jan Kasprzak (kas@informatics.muni.cz)
Fri, 4 Jun 1999 16:46:17 +0200


Nick Phillips wrote:
: Having decided to use Perl, I looked at the Modem::Vgetty module, and
: tried to use that.
: Turns out that the useful bit is pretty seriously broken, so I've
: started work on a module
: based on that, but a little more to my taste (simpler, and no messing
: with event handlers).

	Well, what part of it is broken? I will try to look at it.
Today I have resurrected my year-old voice application and (surprise,
surprise), it seems it works even with newer vgetty and the current
Modem::Vgetty (0.03) module. Even the readnum routine works for me. What's
wrong with the module for you?

	I think it would be better to extend/improve the current module.
I don't see a way of creating a powerful-enough interface without the
event-driven programming, but I am open to suggestions. For simpler
menus the readnum() or something similar should be enough and you don't
need to use the event handlers (maybe you need one handler for BUSY_TONE
for exiting the program):

$v = new Modem::Vgetty;

$answer = $v->readnum("$path/$msg.rmd", $timeout, $repeat);
if ($answer eq '123') {
	something;
} elsif ($answer eq '4567') {
	something else;
} else {
	$v->play_and_wait("$path/wrong_code.rmd");
}

-Yenya
	

-- 
\ Jan "Yenya" Kasprzak <kas at fi.muni.cz>       http://www.fi.muni.cz/~kas/
\\ PGP: finger kas at aisa.fi.muni.cz   0D99A7FB206605D7 8B35FCDE05B18A5E //
\\\             Czech Linux Homepage:  http://www.linux.cz/              ///
||||   > Where do the -- MARK --s  come from ?                          ||||
||||   It is the sound of Tux the penguin chewing on your system logs.  ||||