in reply to Re^3: Mr. Ternary is greater than Mrs. If Else
in thread Mr. Ternary is greater than Mrs. If Else
well first of all im not that good in understanding english terms that are so deep for me. but then let me rephrase your question... well correct me if im wrong... maybe you were asking me that, why did i use "\&" instead of eval, and because they have different functions right?
my answer would be as follows:
a couple of hours ago i was trying (tweaking) to make Mr. Ternary operator work on multi-statements. i tried a sub function definition inside the ternary but it didn't succeed, and so on and so forth. until i came up with that compilation error "Can't use string ("1") as a subroutine ref while "strict refs" ....". so i checked the documentation right away and found that exception in strict pragma "\&". but i didn't make use of it immediately instead i tried to use the eval block. since the eval block is just a single statement that can be used as a container of my multi-statements to function in Mr. Ternary. then, it succeeded. next is i tried to use the "\&", replace the word "eval" with that, and it worked well.
so to wrap up my observations between "eval" and "\&":
"\&" - is used while bullet proofing a program because it permits runtime error to exit my program so sudden. so the programmer could easily notice the error.
"eval" - is used when you have finished bullet proofing a program. well it just trap runtime errors that was not caught by the programmer.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Mr. Ternary is greater than Mrs. If Else
by shmem (Chancellor) on May 19, 2007 at 19:23 UTC | |
by PerlPhi (Sexton) on May 19, 2007 at 19:40 UTC | |
|
Re^5: Mr. Ternary is greater than Mrs. If Else
by blazar (Canon) on May 20, 2007 at 12:26 UTC |