Device-Modem
view release on metacpan or search on metacpan
lib/Device/Modem.pm view on Meta::CPAN
=head2 Things C<Device::Modem> can do
=over 4
=item *
connect to a modem on your serial port
=item *
test if the modem is alive and working
=item *
dial a number and connect to a remote modem
=item *
work with registers and settings of the modem
=item *
lib/Device/Modem.pm view on Meta::CPAN
=head2 Examples
In the `examples' directory, there are some scripts that should work without big problems,
that you can take as (yea) examples:
=over 4
=item `examples/active.pl'
Tests if modem is alive
=item `examples/caller-id.pl'
Waits for an incoming call and displays date, time and phone number of the caller.
Normally this is available everywhere, but you should check your local phone line
and settings.
=item `examples/dial.pl'
Dials a phone number and display result of call
lib/Device/Modem.pm view on Meta::CPAN
=head2 hangup()
Does what it is supposed to do. Hang up the phone thus terminating any active call.
Usage:
$ok = $modem->hangup();
=head2 is_active()
Can be used to check if there is a modem attached to your computer.
If modem is alive and responding (on serial link, not to a remote call),
C<is_active()> returns true (1), otherwise returns false (0).
Test of modem activity is done through DSR (Data Set Ready) signal. If
this signal is in off state, modem is probably turned off, or not working.
From my tests I've found that DSR stays in "on" state after more or less
one second I turn off my modem, so know you know that.
Example:
if( $modem->is_active() ) {
( run in 1.670 second using v1.01-cache-2.11-cpan-39bf76dae61 )