learn PPI 1: double to single
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.
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.
Labels: PPI
0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home