unless ( (!($args =~ /\-rs(\s+)(\S+)/)) && (!($args =~ /\-p(\s+)(\S+)/)) && (!($args =~ /\-P(\s+)(\S+)/)) ) {..... # I figure this is easier to understand: if ( $args =~ /\-rs(\s+)(\S+)/ #update changed unless->if or $args =~ /\-p(\s+)(\S+)/ or $args =~ /\-P(\s+)(\S+)/ ) {....