in reply to Opinion: where Perl5 wasn't attractive for me
1) Perl does not have integer division operator. It must call "use/no integer" to change type. Python has: / - normal division, // - integer division. Sugar.True.
2) It is not problem for me to read dollars in single variables. But it is annoying to read them in some-dimensional arrays (it's noisy), e.g. $array[$i][$j] > $array[$i][$j-1]Some find $array->[ $i ][ $j ] easier to read, but it adds some typing.
It is strongly recommended to "use strict" and make variables "my", then why it is not default? Whay all the code must have so much my my my my...?There are some reasons, but true, even more typing.
Doesn't work - "$_ = reverse";$_ = scalar reverse works. Additional word.
If in subroutine I can write "$_ = shift", why can't I write so in main (I need to write "$_ = shift @_").@_ is meaningless at the top level. Not true, shift shifts from @ARGV there.
5) It was strange that "cho(m)p" returns last symbol, not a string w/o last symbol. Ruby's cho(m)p I like more, because I can proceed on string: gets.cho(m)p.split.do_smth...True, that's very terse. Idiomatic Perl is different and longer.
Can't use blocks using "and/or": "$i > 5 or {print "No"; last}"True, need to use or do { ... }
(overcome - "$i > 5 or (print "No"), last"; comma is tighter than "or" but it is counter-intuitive for me)Not true, || is tighter then comma. Nothing 'counter-intuitive' about that. perl -E 'for (;;) { 10 > 5 || say( "No" ), last }' works like the OP seems to want it to work.
It was suprise for me that when I used "$hash{length}" it interpreted (length $_) as "length"; Surprise was that ++ has magic (I need to know exceptions) and -- has not; Surprise that "use bigint" doesn't DWIM in some cases.Well, there're surprising thing in all languages. Let's say, true, even if those particular surprises are not very convicing, there are many more examples.
perl -CO -Mutf8 -wE 'my ( $x, $y ) = qw( a а ); say ++$x; say ++$y'
Difficult exception is that "print (1+1)*2" != "print 2*(1+1)" == "print STDOUT (1+1)*2". I think "print(..." should better wait until the end of block or ";".Not true, as been said, print has a return value. Omitting parens save characters, that's a good thing.
I think some of their critisim is not justified. Still, it appears to me that the OP would be happier with something like Forth
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Opinion: where Perl5 wasn't attractive for me
by Anonymous Monk on Nov 20, 2014 at 06:41 UTC | |
by johngg (Canon) on Nov 20, 2014 at 09:07 UTC | |
by rsFalse (Chaplain) on Nov 20, 2014 at 11:40 UTC | |
by davido (Cardinal) on Nov 20, 2014 at 15:56 UTC | |
|
Re^2: Opinion: where Perl5 wasn't attractive for me
by rsFalse (Chaplain) on Nov 20, 2014 at 12:23 UTC | |
by roboticus (Chancellor) on Nov 20, 2014 at 12:38 UTC | |
by rsFalse (Chaplain) on Nov 20, 2014 at 13:01 UTC | |
by Anonymous Monk on Nov 20, 2014 at 13:26 UTC |