Help for this page

Select Code to Download


  1. or download this
    >perl -E 'say for grep { $_%2==0 } (1..10)'
    2
    4
    ...
    8
    10
    >
    
  2. or download this
    >perl -E 'use List::Util qw( first ); say first { $_%2==0 } (1..10)'
    2
    >
    
  3. or download this
    >perl -E 'use List::Util qw( any ); say any { $_%2==0 } (1..10)'
    1
    >
    
  4. or download this
    >perl -E 'use List::Util qw( all ); say all { $_%2==0 } (1..10)'
    
    >
    
  5. or download this
    >perl -E 'use List::Util qw( sum ); say sum grep { $_%2==0 } (1..10)'
    30
    >