in reply to Locate emement in array and delete
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.
|
|---|