1Acme::PlayCode::Plugin:U:sEexrchCaonngterCiobnuAdtciemtdei:oP:neP(rl3la)yDCoocduem:e:nPtlautgiionn::ExchangeCondition(3)
2
3
4
6 Acme::PlayCode::Plugin::ExchangeCondition - Play code with exchanging
7 condition
8
10 use Acme::PlayCode;
11
12 my $app = new Acme::PlayCode;
13
14 $app->load_plugin('ExchangeCondition');
15
16 my $played_code = $app->play( $code );
17 # or
18 my $played_code = $app->play( $filename );
19 # or
20 $app->play( $filename, { rewrite_file => 1 } ); # override $filename with played code
21
23 if ( $a eq "a" ) {
24 print "1";
25 } elsif ( $b eq 'b') {
26 print "2";
27 } elsif ( $c ne qq~c~) {
28 print "3";
29 } elsif ( $c eq q~d~) {
30 print '4';
31 }
32
33 becomes
34
35 if ( "a" eq $a ) {
36 print "1";
37 } elsif ( 'b' eq $b ) {
38 print "2";
39 } elsif ( $c ne qq~c~) {
40 print "3";
41 } elsif ( q~d~ eq $c ) {
42 print '4';
43 }
44
46 Acme::PlayCode, Moose, PPI, MooseX::Object::Pluggable
47
49 Fayland Lam, "<fayland at gmail.com>"
50
52 Copyright 2008 Fayland Lam, all rights reserved.
53
54 This program is free software; you can redistribute it and/or modify it
55 under the same terms as Perl itself.
56
57
58
59perl v5.36.0 2A0c2m2e-:0:7P-l2a2yCode::Plugin::ExchangeCondition(3)