SUMMARY

C<$var ?= $x : $y> as a shortcut for C<$var = $var ? $x : $y>.


DETAILS

We have ||=, +=, -=, etc.  These shortcuts (I'm sure there's some fancy
linguistic term for them) save us a few keystrokes and clean up the code.

So, concerning C<? :>, I find myself doing this type of thing a lot:

    $var = $var ? 1 : 0;

How 'bout a shortcut for that, something like this:

    $var ?= 1 : 0;


-miko



Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke

Reply via email to