Because I can\'t find a convenient way to check if $str is in @array, I\'m trying to make one myself, but it is not working.
$str
@array
I guess it is
You could pass your arguments in reverse order (print ifin($k, @f);), so array is going last. When you catch them now from subroutine, string comes first and array gets populated with any list items after it.
print ifin($k, @f);