my $keys = "5 10 14 16 17 20 25 26 38 1 42 47 54"; my $substr = '1'; print "\nExist" if $_ eq $substr for split /\s+/, $keys;