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.


In reply to Re^4: Mr. Ternary is greater than Mrs. If Else by PerlPhi
in thread Mr. Ternary is greater than Mrs. If Else by PerlPhi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.