I am receiving output from some process as this and i want to search particular element from the out put of that process using perl I have done as below but still it return FALSE even if there is element.I think something i am doing wrong in parsing help any pointers . Thanks
Output from process:
origin-server-pool-1
http_TestABC
https_TestABC
Script:
use strict;
use warnings;
my @result_listosp; #assigned from output process given above
my $osp="http_TestABC";
my $status_osp_check= check_if_entity_exists($osp,@result_listosp);
print $status_osp_check;
sub check_if_entity_exists()
{
my $entity = shift;
my @entityarray = @_;
my $status="FALSE";
if ( grep { $_ eq $entity} @entityarray) {
$status="TRUE";
return $status;
}
else {
return $status;
}
}