use Device::Modem; my $Port = "COM7"; my $Modem = Device::Modem->new( port => $Port ); if ( !defined $Modem ) { die "Cannot Connect to Port '$Port'\n"; } if ( !$Modem->connect( baudrate => 9600 ) ) { die "Not Connected to '$Port'\n"; } my @attachArray = ( "ATI", "AT+CLIP=1"); for ( my $ii = 0 ; $ii <= $#attachArray ; $ii++ ) { print "Sending $attachArray[$ii]\n"; $Modem->atsend( "$attachArray[$ii]" . Device::Modem::CR ); my ( $status, @output ) = $Modem->parse_answer(); sleep(10); print "$status\n"; foreach(@output){ print "$_\n"; } }