NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
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.
Reply to This
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 ...