@array = map { m{ \s* # skip leading whitespace ( # then capture .* # the longest possible substring \S # that ends with a visible character ) }x } @array;