optimize (and ... NO) to null if no gvsv/padsv, else (dor $x) or do some SvGETMAGIC. (and NO) is always false, but all SVs must call their mg_get for all SVs before not.
$ perl -MO=Concise,-exec -e'if ($a and "x" eq "y") { print $s;}' 1 <0> enter 2 <;> nextstate(main 3 -e:1) v:{ 3 <$> gvsv(*a) s 4 <|> and(other->5) sK/1 5 <$> const(SPECIAL sv_no) s 6 <|> and(other->7) vK/1 7 <0> pushmark s 8 <$> gvsv(*s) s 9 <@> print vK a <@> leave[1 ref] vKP/REFC
can be optimized to
1 <0> enter 2 <;> nextstate(main 3 -e:1) v:{ 3 <$> gvsv(*a) s 4 <1> dor vK/1 a <@> leave[1 ref] vKP/REFC
$ perl -MO=Concise,-exec -e'my $a; if ($a and "x" eq "y") { print $s;}' 1 <0> enter 2 <;> nextstate(main 1 -e:1) v:{ 3 <0> padsv[$a:1,4] vM/LVINTRO ... 4 <;> nextstate(main 4 -e:1) v:{ 5 <0> padsv[$a:1,4] s 6 <|> and(other->7) sK/1 7 <$> const[SPECIAL sv_no] s 8 <|> and(other->9) vK/1 9 <0> pushmark s a <#> gvsv[*s] s b <@> print vK c <@> leave[1 ref] vKP/REFC
1 <0> enter 2 <;> nextstate(main 1 -e:1) v:{ 3 <0> padsv[$a:1,3] vM/LVINTRO ... 4 <;> nextstate(main 2 -e:1) v:{ 5 <$> padsv([$a:1,3) s 6 <1> dor vK/1 7 <@> leave[1 ref] vKP/REFC
$ perl -MO=Concise,-exec -e'if ("x" eq "y" and $a) { print $s;}'
is already optimized to
1 <0> enter 2 <;> nextstate(main 3 -e:1) v:{ 3 <@> leave[1 ref] vKP/REFC
To install optimizer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm optimizer
CPAN shell
perl -MCPAN -e shell install optimizer
For more information on module installation, please visit the detailed CPAN module installation guide.