in reply to encoding URL ampersands?

I think you're looking for URI::Escape.