in reply to Re^11: printing unitialized value of the 'do BLOCK'
in thread printing unitialized value of the 'do BLOCK'
This thread is hard to follow, so my 2 cents to sum it up
If you doubt it, that's how it shows in the op-tree
So yes if and unless are effectively expressions in the form of statements, but returning values.
Did I miss an aspect of this thread?
C:\WINDOWS\system32>perl -MO=Concise -e"if ($x) { print $x }" 8 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 - <1> null vK/1 ->8 4 <|> and(other->5) vK/1 ->8 # if +-> and - <1> ex-rv2sv sK/1 ->4 3 <#> gvsv[*x] s ->4 - <@> scope vK ->- - <;> ex-nextstate(main 3 -e:1) v ->5 7 <@> print vK ->8 5 <0> pushmark s ->6 - <1> ex-rv2sv sK/1 ->7 6 <#> gvsv[*x] s ->7 -e syntax OK C:\WINDOWS\system32>perl -MO=Concise -e"unless ($x) { print $x }" 8 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 - <1> null vK/1 ->8 4 <|> or(other->5) vK/1 ->8 # unl +ess -> or - <1> ex-rv2sv sK/1 ->4 3 <#> gvsv[*x] s ->4 - <@> scope vK ->- - <;> ex-nextstate(main 3 -e:1) v ->5 7 <@> print vK ->8 5 <0> pushmark s ->6 - <1> ex-rv2sv sK/1 ->7 6 <#> gvsv[*x] s ->7 -e syntax OK C:\WINDOWS\system32>perl -MO=Concise -e"unless (0) { print $x }" 6 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 - <@> scope vK/FOLD ->6 - <;> ex-nextstate(main 3 -e:1) v ->3 5 <@> print vK ->6 # alw +ays true 3 <0> pushmark s ->4 - <1> ex-rv2sv sK/1 ->5 4 <#> gvsv[*x] s ->5 -e syntax OK C:\WINDOWS\system32>perl -MO=Concise -e"unless (1) { print $x }" 3 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 # nev +er true - <0> ex-const v/SHORT ->3 -e syntax OK
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^13: printing unitialized value of the 'do BLOCK' (summary)
by ikegami (Patriarch) on Dec 26, 2019 at 09:07 UTC | |
by rsFalse (Chaplain) on Dec 26, 2019 at 12:14 UTC | |
by LanX (Saint) on Dec 26, 2019 at 14:48 UTC | |
by ikegami (Patriarch) on Dec 27, 2019 at 06:16 UTC | |
by LanX (Saint) on Dec 27, 2019 at 17:20 UTC | |
| |
by ikegami (Patriarch) on Dec 27, 2019 at 05:55 UTC |