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