if( $tmp > 0 ) { $sip_response .= "$line\n"; } #### my $sip_response = $response; # Make a copy of the response. if( $sip_response =~ s{^[^\n]+}[200 SIP/2.0 OK] ) { print $sip_response; } else { die "Didn't understand the response: $response\n"; }