in reply to Apocalypse 3
is short for:$a // $b
except 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 # [note: this is the new ?: -- bla +kem]
That's actually quite cool... currently when people use $a ||= b they often times really mean $a = defined ($a) ? $a : $b and now we'll have an easy way to do it..$pi //= 3;
//= gets a ++ in my book
-Blake
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Apocalypse 3
by pixel (Scribe) on Oct 04, 2001 at 12:10 UTC | |
Re: Re: Apocalypse 3
by MrNobo1024 (Hermit) on Oct 04, 2001 at 02:53 UTC | |
by japhy (Canon) on Oct 04, 2001 at 05:11 UTC | |
by TheDamian (Vicar) on Oct 04, 2001 at 14:24 UTC | |
by japhy (Canon) on Oct 04, 2001 at 18:26 UTC | |
by TheDamian (Vicar) on Oct 05, 2001 at 12:03 UTC | |
by Anonymous Monk on Oct 04, 2001 at 05:03 UTC | |
by grinder (Bishop) on Oct 04, 2001 at 19:47 UTC |