SPUG: idioms of late

Michael R. Wolf MichaelRWolf at att.net
Tue Jan 19 00:17:12 PST 2010

On Jan 18, 2010, at 8:10 PM, Andrew Sweger wrote:


> for using
> the DBI/DBD quote method (as opposed to the insane DIY one I found  
> in some
> legacy code!).

And, while you're talking about DIY in maintained code, remember that  
Gisle has created a bunch of great URI manipulation routines, so  
there's no need to escape them yourself...

$ perl -MURI::Escape -e 'print uri_escape(chr($_)) foreach 0..0x7F'

(It'll go up to 0xFF without needing to use uri_escape_utf8(), but  
it's not really interesting above 0x7F)

Who's got the time to look 'em all up and get 'em right?  Not me.   
Great set of routines, those URI::* modules.

I've seen some code that has to munge this to conform to PHP  
conventions (e.g. s/%20/+/g), but I'd still rather start with the  
standard instead of a DIY.

Michael R. Wolf
     All mammals learn by playing!
         MichaelRWolf at att.net

More information about the spug-list mailing list