Think about Loose Coupling | |
PerlMonks |
Results depending on evaluation orderby fishy (Friar) |
on Apr 23, 2014 at 16:30 UTC ( [id://1083387]=perlquestion: print w/replies, xml ) | Need Help?? |
fishy has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I was trying the code from Okay! What!?!?!? Output:
and from My floating point comparison does not work. Why ? Output:
when I came up with the following behavior (tested on Perl 5.10.1 and on 5.18.2): Swapping operands on the first sample code:
Using eval:
Using eval on the second sample code: Output:
So, I got odd results depending on the order of the operands and right results on evaluating. How can that be?
Back to
Seekers of Perl Wisdom
|
|