News for hackers. Stuff that matters.
Re:If-then-else had to be invented by hnick on Sunday December 13, 2020 @06:43PM (#25411666)
Yes it's a weird feature but I found myself drawn to it. Just like with natural language, sometimes the 'unless' keyword feels like a better fit.

Both keywords work in postfix form, and this is how I usually use 'unless' so it reads more like a sentence.

  do_thing() unless ($a == 1);
  do_thing() if ($a != 1);

There are no comments on this comment yet.