in reply to Re: logical-assignment operators
in thread logical-assignment operators

Here is one example of where ||= is useful... If this regex doesn't match then $license_class is undefined. Instead of some kind of "if" code that does something "if (!defined ...)", this just sets the default case "BAD_CLASS" if that happens.
my $license_class = ($raw_html =~ m|Class:</td><td class="di">(\w+?) |)[0]; $license_class ||= "BAD_CLASS";