Perl's lack of 'in' keyword
iainspeed at gmail.com
Thu Oct 9 01:39:02 BST 2008
On 9 Oct 2008, at 12:59 am, Paul LeoNerd Evans wrote:
> Perhaps a better comparison may be
> my $foo = $a + $b;
> add scalar a to the fifth element of array b and assign to new
foo = a + b
The $@% etc signs are misplaced in modern perl (which is shown
through Ruby's better use of them). A lot of the braces and brackets
and ; could all be (to a large extent) kicked out of the language.
Ruby manages it. Haskell manages it. C# is getting closer to it. I
don't know more than a drop of Python but it looks cleaner (from a
distance). Why keep in a load of stuff just because it was there in
version 4 and just because a (new language) version called Perl6 may
be completed soon.
> but then does it really buy all that much?
For me, it says what I mean vs doing what I mean, which is why a lot
of projects choose other languages which may be more verbose or "less
expressive", but ultimately are easier to read than perl.
if $a ~~ $b #this could mean several things
if $a in $b #it is clear what this means
if a in b #this is even better IMO
More information about the london.pm