Help for this page

Select Code to Download


  1. or download this
    $ perl -E 'my @x = qw{A B C D}; @x = grep $_ ne "B", @x; say "@x"'
    A C D
    
  2. 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
    
  3. 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
    
  4. 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
    
  5. 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
    
  6. 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)