18 October 2008
This post may be outdated due to it was written on 2008. The links may be broken. The code may be not working anymore. Leave comments if needed.
well, I'm very strict on Perl code (more than use strict;).
I want code like my $a = "a"; becomes my $a = 'a'; since it's better.
I'm not considering the speed since it's trivial for " to '. but u'd admit, 'a' is faster than "a".

PPI is really amazing.
it breaks Perl code down into the Perl document/structure we can read and analyze.

To do the task above. I just wrote a script based on PPI.
http://fayland.googlecode.com/svn/trunk/script/learn_ppi/01DoubleToSingle.pl
OK, it's my first time try with PPI, and it's really easy to understand and coding.

Many thanks to Adam Kennedy.

next time, I think I'll deal with
if ( $a eq 'a' ) {
to
if ( 'a' eq $a ) {

I think it's fun. and good to learn a new good thing.

Enjoy and have fun.


blog comments powered by Disqus