in reply to apostrophes and security

Try URI::Escape