[lug] perl and wvdial

D. Stimits stimits at attbi.com
Mon Mar 10 15:08:17 MST 2003


jdavis wrote:

> Hello,
>   I am writing a script to help a user turn a modem
> on and off and adjust the routing tables on a
> Linux box. I am trying to call wvdial to do the dialing,
> but it does not give control back to my script. I call
> it like so
>
> if( $choice == 1){
>         `wvdial`;
>         print "connected";
> }
>
> I also have tried..
>
> if( $choice == 1){
>         `wvdial&`;
> }
>
> but nothing after `wvdial` gets ran.
> could someone offer me some advice...please :) ?


wvdial is blocking, so the latter is the right idea, but wrong way. You 
need something like:

my $command = "\/bin\/bash wvdial"
system( "${command}" );

D. Stimits, stimits AT attbi DOT com




More information about the LUG mailing list