Help for this page

Select Code to Download


  1. or download this
    $ perl -E 'say grep {++$i %2} <a b c d e f g>'
    aceg
    $ perl -E 'say grep {$i++ %2} <a b c d e f g>'
    bdf
    
  2. or download this
    $ perl6 -e 'my @a = "a".."g"; say @a[0, *+2 ... +@a]'
    aceg
    
  3. or download this
    @a[0, *+2 ... *]
    
  4. or download this
    say <a b c d e f g>.pairs.grep({.key !% 2})>>.value