LanX has asked for the wisdom of the Perl Monks concerning the following question:
(it's the flip-flop not the range operator!)
IIRC (returned) boolean values in perl are either 1 or undef.
so why does this
perl -e 'print scalar (a..d),"\n"' 1E0
return a float?
Here the op-codes
perl -MO=Terse -e 'print scalar (a..d)' LISTOP (0x8982558) leave [1] OP (0x8982390) enter COP (0x89828c0) nextstate LISTOP (0x89824d0) print OP (0x897a7f8) pushmark UNOP (0x8982608) scalar UNOP (0x89825d0) null UNOP (0x8982668) flop UNOP (0x8982688) flip [2] LOGOP (0x89826f0) range [1] SVOP (0x89828a0) const [4] PV (0x8960920) +"a" SVOP (0x89827e0) const [3] PV (0x897ee88) +"d" -e syntax OK
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Booleans from flip-flops
by ikegami (Patriarch) on Jan 20, 2010 at 18:20 UTC | |
|
Re: Booleans from flip-flops
by JavaFan (Canon) on Jan 20, 2010 at 18:06 UTC | |
by LanX (Saint) on Jan 20, 2010 at 18:17 UTC | |
by ikegami (Patriarch) on Jan 20, 2010 at 18:25 UTC | |
by LanX (Saint) on Jan 20, 2010 at 18:54 UTC | |
by ikegami (Patriarch) on Jan 20, 2010 at 19:19 UTC | |
|