Contact Info

(for those who care)

Instant Gratification   



Wed, 31 Oct 2007

Perl and a few other tips

So it turns out that perl is not as bad as I always thought it to be.

You might be familiar with “perl pie”, which is a “program, inplace, execute”. In some cases I’m finding it to be far superior to sed, because it’s regular expressions don’t suck. Notably, you can do the following:

perl -p -i -e 's/\r/\n/g' ...file...

This will convert line endings in place.

Another handy-dandy tip from the grab-bag is that Mozilla FireBug’s “*.toSource()” function takes an optional parameter, which appears to mean: “print functions with some semblance of indentation”. It is extremely nice when trying to inspect the behaviour of code or a function without resorting to debug( fnRef ); fnRef( myArgs );.

And while on the topic of FireBug, you can also use the inspect( domRef ); to pull you directly over to the element in question using it’s built-in DomViewer.

18:57 CST | category / entries
permanent link | comments?

Like what you just read? Subscribe to a syndicated feed of my weblog, brought to you by the wonders of RSS.



Thanks for Visiting!