* Andy Armstrong <overwater at mac.com> [2007/10/10 21:36]: > Particularly in web applications - but in other areas too - people > regularly make a complete mess of escaping / unescaping strings. At > different times a string may need to be > > * unescaped plain text > * SQL quoted > * entity encoded > * url encoded > * json encoded > * etc
I was just thinking about this recently, too, although in my head it was more like the built-in \U, \E, and \Q operators, so: my $str = as html => "I like <strong>cake</strong>"; Would be something like: my $str = "I like \H<strong>cake</strong>\E!"; assuming \H did HTML escaping, or: my $enc = "\Zhttp://example.com/"; assuming \Z did URI esaping. I'm not sure how to do this without adding it to the core or using a source filter. (darren) -- The most profound technologies are those that disappear. They weave themselves into the fabric of everyday life until they are indistinguishable from it. -- Mark Weiser
signature.asc
Description: Digital signature