Also consider using the
CGI module's "escape" method (undocumented) for performing URI escapes like this. It's not that this is some proprietary Napster thing, it's the way things need to be escaped to make sense in the HTTP world. Consider the possibility that there will be a
> in your data, or an
&. Best to do something like this and your data is reasonably safe:
s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg;