- or download this
$ perl -E 'my @x = qw{A B C D}; @x = grep $_ ne "B", @x; say "@x"'
A C D
- or download this
$ perl -E 'my @x = qw{A B C D}; my $y = "B"; @x = (grep($_ ne $y, @x),
+ $y); say "@x"'
A C D B
- or download this
$ perl -E 'my @x = qw{A B C D}; my $y = "Z"; @x = (grep($_ ne $y, @x),
+ $y); say "@x"'
A B C D Z
- or download this
$ perl -E 'my @x = qw{A B C D}; my $y = "Z"; @x = (grep($_ ne $y, @x),
+ $y)[0..$#x]; say "@x"'
A B C D
- or download this
$ perl -E 'my @x = qw{A B C D}; my $y = "B"; @x = (grep($_ ne $y, @x),
+ $y)[0..$#x]; say "@x"'
A C D B
- or download this
$ perl -E 'my @history = qw{Cache::SizeAwareMemoryCache(3) dhcp-option
+s(5) BN_add_word(3) audit-packages(8)}; my $choice = "dhcp-options(5)
+"; @history = (grep($_ ne $choice, @history), $choice); say "@history
+"'
Cache::SizeAwareMemoryCache(3) BN_add_word(3) audit-packages(8) dhcp-o
+ptions(5)
...
$ perl -E 'my @history = qw{Cache::SizeAwareMemoryCache(3) dhcp-option
+s(5) BN_add_word(3) audit-packages(8)}; my $choice = "not-found(0)";
+@history = (grep($_ ne $choice, @history), $choice)[0..$#history]; sa
+y "@history"'
Cache::SizeAwareMemoryCache(3) dhcp-options(5) BN_add_word(3) audit-pa
+ckages(8)