A classic example of weird editor settings. Unless of course that is your favourite indenting style.
Anyway, I think encode_url is a bad name for a function that does not URL-encode (i.e. the %-thing). It does not even have anything to do with URLs. In fact, I would not have used a separate sub for it.
But, as always, it works and it serves a purpose. As does most software.
It just needed a %retab. Looks much neater now, darn tabs.
The reason it's called encode_url is because it encodes the entities in a url. If it was going to do the %-thing, it would be escaping (using URI::Escape). At least that's how I distinguish between the two things, I could be wrong.
Which means some people call it escaping, some call it encoding. Perlfaq9 calls it encoding, URI::Escape calls it escaping.
The thing is exactly the same with HTML Entities: it is escaping AND encoding. Encoding because it changes in a way that can be reversed, escaped because most text is as it is and an escape character (% in a URI, & in HTML) is used to introduce an encoded octet/character..
I'd expect a sub called encode_url to URI-encode because of the
the script (Score:2)
Anyway, I think encode_url is a bad name for a function that does not URL-encode (i.e. the %-thing). It does not even have anything to do with URLs. In fact, I would not have used a separate sub for it.
But, as always, it works and it serves a purpose. As does most software.
Re:the script (Score:2)
The reason it's called encode_url is because it encodes the entities in a url. If it was going to do the %-thing, it would be escaping (using URI::Escape). At least that's how I distinguish between the two things, I could be wrong.
Re:the script (Score:2)
Which means some people call it escaping, some call it encoding. Perlfaq9 calls it encoding, URI::Escape calls it escaping.
The thing is exactly the same with HTML Entities: it is escaping AND encoding. Encoding because it changes in a way that can be reversed, escaped because most text is as it is and an escape character (% in a URI, & in HTML) is used to introduce an encoded octet/character..
I'd expect a sub called encode_url to URI-encode because of the