in reply to How to deal with undefined returned variables.
A binary // operator is the defaulting operator.Perl 6 should be such fun!
That is:is short for:$a // $bexcept that the left side is evaluated only once. It will work on arrays and hashes as well as scalars. It also has a corresponding assignment operator, which only does the assignment if the left side is undefined:defined($a) ?? $a :: $b$pi //= 3;
|Replies are listed 'Best First'.|
Re: Answer: How to deal with undefined returned variables.
by rinceWind (Monsignor) on Mar 06, 2002 at 17:00 UTC