in reply to Re: return value of "if" (documentation?)
in thread return value of "if" (documentation?)
Deparse tries to reproduce code, while Concise shows what's actually there.
A more accurate demonstration:
$ perl -MO=Concise,-exec -e'print if $a' 1 <0> enter 2 <;> nextstate(main 1 -e:1) v:{ 3 <#> gvsv[*a] s 4 <|> and(other->5) vK/1 5 <0> pushmark s 6 <#> gvsv[*_] s 7 <@> print vK 8 <@> leave[1 ref] vKP/REFC -e syntax OK $ perl -MO=Concise,-exec -e'$a and print' 1 <0> enter 2 <;> nextstate(main 1 -e:1) v:{ 3 <#> gvsv[*a] s 4 <|> and(other->5) vK/1 5 <0> pushmark s 6 <#> gvsv[*_] s 7 <@> print vK 8 <@> leave[1 ref] vKP/REFC -e syntax OK
But the question is about the if statement.
$ perl -MO=Concise,-exec -e'if ($a) { print }' 1 <0> enter 2 <;> nextstate(main 3 -e:1) v:{ 3 <#> gvsv[*a] s 4 <|> and(other->5) vK/1 5 <0> pushmark s 6 <#> gvsv[*_] s 7 <@> print vK 8 <@> leave[1 ref] vKP/REFC -e syntax OK
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: return value of "if" (documentation?)
by LanX (Saint) on Jan 08, 2014 at 15:32 UTC | |
by ikegami (Patriarch) on Jan 08, 2014 at 20:33 UTC |