Thanks for the correction tilly! I should have known better. Agreed all functions return a value unless called in a void context!!!

When i started to play around with BrowserUk's statement on functions that return a value (with explicit return in my case) I realized i did not have that in mind when i wrote for the otherwise idea... So did not reply back saying it will fail under that instance coz i am not using the return value either in my code. What i forgot in the process was that subs implicitly return the last expression evaluated and the problem of returning false will execute both functions even if an explicit return in not used

I guess after reading jdporter's post and your question about functions returning false values, I guess it makes me feel otherwise will be a good feature if one want to write such conditional statements

I know it is too late in the game to think about such additions but it is nice to discuss!

-SK


In reply to Re^6: Useless unless by sk
in thread Useless unless by GrandFather

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.