In the spirit of TMTOWTDI I offer:
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
my %remove = map {; "--$_" => 1 } qw{ config enter };
{
local $" = ', ';
say "Before array splicing: @ARGV";
@ARGV = grep ! $remove{$_}, @ARGV;
say "After array splicing: @ARGV";
}
But honestly, for command-line processing I would go with NERDVANA's answer and use Getopt::Long.
In reply to Re: Locate emement in array and delete
by Anonymous Monk
in thread Locate emement in array and delete
by g_speran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |