>>>>> "LP" == Luke Palmer <[EMAIL PROTECTED]> writes:

  LP> On 4/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
  >> Note that unless no longer allows an else

  LP> Hmm, that's interesting.  I don't _think_ I'm opposed, but maybe I am.
  LP>  The main case that I can see this limiting me is where I like to put
  LP> my error conditions at the end of my code, out of the way, like so:

  LP>     unless $.something {
  LP>         $.something = UsefulData.new;
  LP>     }
  LP>     else {
  LP>         die "Something exists!";
  LP>     }

  LP> I don't want to switch the order of those blocks, and switching the
  LP> condition to "if !$.something" defeats the whole purpose of unless.

in perl5 i like to get the quick stuff like next/last/die out of the
way. it saves a block, indents and else clauses. something like this in
p6 (just your code edited):

        die "Something exists!" if $.something ;

        $.something = UsefulData.new;

i don't like unnecessary blocks and indents if i can help it. unless
with else is very confusing and i never used that. i try to keep my
unless clauses to be very simple. anything complex and i revert to if.

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to