my $status = authenticate($username, $password); if ($status) { #if authenticate() returned a 'TRUE' value # get the test string from somewhere # and then use it in the following test my $is_like = Test::More->like( get_string(), qw/like_regex/, $test_name); }