use Device::Gsm; my $gsm = new Device::Gsm( port => '/dev/ttyS1', pin => 'xxxx' ); if( $gsm->connect() ) { print "connected!\n"; } else { print "sorry, no connection with gsm phone on serial port!\n"; }