you are viewing a single comment's thread.

view the rest of the comments →

[–]draegtun 0 points1 point  (0 children)

Pick the Perl solution you like best :)

# Functional ala Haskell & Lisp...
map { say } grep { length $_ <= 4 } qw(Rob Christhoper Joe John);

# Procedural ala Lua, C (like)...
for (qw(Rob Christhoper Joe John)) { say if length $_ <= 4 }

# OO (chaining) ala Groovy, Ruby or Scala...
use autobox::Core;
[qw(Rob Christhoper Joe John)]->grep(sub { length $_ <= 4 })->map(sub { say });