in reply to Locate emement in array and delete

Well, first off, I would direct you to Getopt::Long which has just about every common option you could want for command line argument parsing. In particular, check out the option pass_through:

pass_through (default: disabled)

With "pass_through" anything that is unknown, ambiguous or supplied with an invalid option will not be flagged as an error. Instead the unknown option(s) will be passed to the catchall "<>" if present, otherwise through to @ARGV. This makes it possible to write wrapper scripts that process only part of the user supplied command line arguments, and pass the remaining options to some other program.

If "require_order" is enabled, options processing will terminate at the first unrecognized option, or non-option, whichever comes first and all remaining arguments are passed to @ARGV instead of the catchall "<>" if present. However, if "permute" is enabled instead, results can become confusing.

Note that the options terminator (default "--"), if present, will also be passed through in @ARGV.

If that can't solve the problem, my default fall-back approach would be to just write a plain old C-style loop:

for (my $i= 0; $i < @ARGV; $i++) { if ($ARGV[$i] eq '--config') { splice(@ARGV, $i, 1); $i-- } }
It isn't pretty or fancy, but it lets you make all the special cases you need, like consuming additional arguments, or skipping over arguments according to the particular rules of the commandline syntax for that program. A more elegant bit of code (if your needs are really simple) is to iterate backwards:
for (reverse 0..$#ARGV) { splice(@ARGV, $_, 1) if $ARGV[$_] eq '--config'; }
but that doesn't give you much opportunity to handle special cases.