On Nov 13, 2007, at 8:15 AM, furtive.clown / gmail.com wrote:

>    class Object
>       def as
>          yield self
>       end
>    end
>
>    input = %w(a b)
>    re = %r!a\Z!
>
>    filename = input.map { |t|
>       t.gsub(re, "_")
>    }.join.as { |t|
>       File.basename(t)
>    }
>
>    puts filename
>    # => _b

Just for the sake of the archives, note that the above should use sub 
() instead of gsub().

Thanks for the explanation.

James Edward Gray II