Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
So if I do this:
$value ||= $default;
I can also do this:
$value &&= munge($value);
However, what's the negated
$value
//= $default;
I'm sure there must be something there, but I'm missing it.
And is not really the negation of or (Score:1)
$value = defined($value) ? $other_value : undef;
but I'm not sure what it would be good for.
Re: (Score:1)
Reminds me of this:
That’s from man bash [man.cx] under “Parameter Expansion”. It comes in handy when you want to decide whether to pass a switch to a program based on the presence of some flag variable.
Re: (Score:2)
It's useful if you want to munge a value if it's defined. I've found it useful when doing something like this:
In other words, if there is no message, don't stick in extraneous paragraph tags in the HTML. I'm sure there are plenty of other cases where you might want to take an extra action if a value is defined.
Re: (Score:1)
Re: (Score:2)
Heh. Something like that :) Now where are my Unicode cheat sheets ...