$session1->expect(30, '-re', qr'^0000:.*\r\n'); my $tmpvar = $session1->match(); my $tmpvar1 = (split (/ +/, $tmpvar))[14]; unless($tmpvar1 eq 'A6') { &snmp_conf_cleanup(); &clean_up_and_exit($session,"FAIL",$mesg,"did not receive any v2 notifications"); }