Changes between Version 8 and Version 9 of PadrePluginFix


Ignore:
Timestamp:
Mar 21, 2012, 1:28:07 PM (3 years ago)
Author:
azawawi
Comment:

Switch statement update with examples

Legend:

Unmodified
Added
Removed
Modified
  • PadrePluginFix

    v8 v9  
    99* if {{{use v5.10;}}} or greater is used, then {{{print "something\n"}}} can be transformed into {{{say "something"}}} 
    1010* Transform {{{my $param1 = shift}}} into {{{my ($param1) = @_; }}} and vice versa 
    11 * Convert if($something) elsif($something) else {} into given($something) { when... } and vice versa 
     11* if-elsif-else transformation into given-when. Please see [http://perldoc.perl.org/perlsyn.html#Switch-statements Switch statements] 
     12 
     13{{{#!perl 
     14if($type eq 'a') { 
     15} elsif($type eq 'b') { 
     16} else { 
     17} 
     18}}} 
     19 
     20  Should become 
     21 
     22{{{#!perl 
     23given($type) { 
     24when ('a') { } 
     25when ('b') { } 
     26default    { } 
     27} 
     28}}} 
    1229 
    1330* Add ''{{{Padre::Document::Perl::Beginner}}}'' checks and convert them to '''PPI'''