- or download this
@a = map {
# A function of $_, eg:
$_ . ".txt"
} @a;
- or download this
# Emulate grep with map
@a = map { elementShouldBeIncluded($_) ? $_ : () } @a;
# Double up the list
@a = map { ($_, $_) } @a;
- or download this
@a = map {
# Is it a dir?
...
# It's a file - pass it straight through
$_
} @a;