Wednesday, July 29, 2009

Search and Replace in Linux

I found this neat snippet as an alternative for 'sed' to search and replace a string in multiple files in Linux. Enjoy:

perl -pi -w -e 's/search/replace/g;' *.php
-e means execute the following line of code.
-i means edit in-place
-w write warnings
-p loop

Thursday, January 15, 2009

Exceptions or Error Codes

Here's an excellent article on exception handling vs. using error codes. And another article on Volatile vs. Const objects in C.