rootstock has asked for the wisdom of the Perl Monks concerning the following question:

i want to parse the answer from a modem then count how many times the dial was successful or the line was idle or not.
modem->is_active() returned active, ($ok, $answer) = $modem->dial('mynumber',5); # dial phone number print "ok=$ok, answer=$answer\n";

i met two problem at this line, one is the timeout setting did not work, after 5 second the phone was still ringing. another problem is $ok and $answer was empty. nothing was print out.

the i tried sending AT command and failed either

$answer1=$modem->atsend( 'ATD38813453'); print "answer is "; print $modem->answer(); print "\n"; print "answer1 is $answer1\n"; print "\n"; print "at command was sent\n";

i got follwing on the screen

answer is ATD38813453 answer1 is 1
could you tell me which part i did wrong ? thank you so much.

20030525 Edit by Corion: Fixed formatting and changed title from "Device::Modom question, could not get the return, please help"

Replies are listed 'Best First'.
Re: Device::Modem question, could not get the return, please help
by Mr. Muskrat (Canon) on May 26, 2003 at 13:23 UTC
    You might try the example scripts included with the module. Start out with active.pl to see if the module sees the modem as active.
      sorry, i omitted some script at the start i could connect to the modem and modem was active which i was quite sure since i could heard the dial tone from the modem.
        Do any of the example scripts work for you? If so, then perhaps you could show us the entire script that is failing.