[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Strange Operators (Was: Why I leave Lua)
- From: mniip <mniip@...>
- Date: Thu, 10 Jul 2014 05:26:12 +0400
On 07/10/2014 04:05 AM, Coroutines wrote:
> On Wed, Jul 9, 2014 at 5:03 PM, Paige DePol <lual@serfnet.org> wrote:
>
>> What other strange operators have been spotted in the wild?
> The spaceship operator is my favorite ("<=>"):
> https://en.wikipedia.org/wiki/Spaceship_operator
>
How about the goatse operator, ''=()='', which forces RHS into an array
context?
Example usage:
$a = "hello world" =~ /l/g; # $a gets 1 (or undef if the pattern
wouldn't have matched)
$a =()= "hello world" =~ /l/g; # $a gets 3, the amount of times the
pattern matched