Actually, i was looking for the same thing a while ago (didn't find anything)
i'm a bit surprised that everybody's soooo against thing thing. i, for one, have a Tk script littered with
sub bar { $foo = askFor( title => 'Name:' ); return undef if not defined $foo; $baz = askFor( title => 'Cigarettes:' ); return undef if not defined $baz; }
stuff. &askFor simpy pops up an entry form that offers a 'cancel', which MUST cancel the caller (&bar), so for me a double-return would be great. (a significant portion of my code is starting to be this dumb "return if .." thing
but i always remember that i started of with BASIC, and am therefore not able to grasp the horrendous evilness of this (someone once pointed out that a double return would be a GOTOism (which would be bad)).
could someone explain why this would lead to spaghetti code, and other nasty stuff?
(i'm really afraid that i'm doing things now that'll make me loose my hair in a week)

In reply to Re: Double your return!!!! by schweini
in thread Double your return!!!! by bsb

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.