Perl's lack of 'in' keyword
Paul Makepeace
paulm at paulm.com
Thu Oct 9 12:19:13 BST 2008
On Thu, Oct 9, 2008 at 11:51 AM, Andy Armstrong <andy at hexten.net> wrote:
> On 9 Oct 2008, at 01:39, Iain Barnett wrote:
>>
>> if $a ~~ $b #this could mean several things
>
> A smart match between two scalars. Clear.
>
>> if $a in $b #it is clear what this means
>
> One scalar is in another? WTF?
>>> "ass" in "assume"
True
>> if a in b #this is even better IMO
>
>
> Dunno what a and b are - so who knows what it does?
>>> fun = ("beer", "buffy", "pie", "perl")
>>> "perl" in fun
True
Because you write your language so that the commonly understood
meaning of the keyword is manifested in its implementation?
> Which is not, of course, to say that you're wrong - but that readability is
> - to some extent - in the eye of the beholder.
>
> --
> Andy Armstrong, Hexten
>
>
>
>
More information about the london.pm
mailing list