#!/usr/bin/perl use warnings; use strict; use Tk; #use Device::Modem; #my $modem = new Device::Modem( log =>'file,modemlog',port => '/dev/ttyS1' ); my $mw = MainWindow->new; $mw->Label( -text => 'press q to quit dial' )->pack; $mw->Button(-text=> 'Start Dial', -command => \&start_dial )->pack; $mw->Button(-text=> 'Quit', -command => \&exit )->pack; $mw->bind( '' => \&stop_dial ); MainLoop; sub start_dial{ print "dial started\n"; #you would do something like #$modem->dial('123-456-2345'); } ############################ sub stop_dial { print "q pressed\n"; # do something like # $modem->reset(); } __END__