sub is_allowed { my $s = shift; return 1 if $s eq 'NONE'; my %allowed, %seen; @allowed{split /,/,'-config,-files,-params,-driverPath,-appPath,-batchPath'} = (); ### (incorrect line)return if !exists $allowed{$_} or $seen{$_}++ foreach split /,/, $s; (!exists $allowed{$_} or $seen{$_}++) and return foreach split /,/, $s; return 1; }