>> 2) chomp(@foo); is simpler than @foo = map chomp, @foo;.
I meant "chomp(@foo)" - would do as it did. Only what it return differs. But then we couldn't get last character - that's also bad.
>> Making an exception for length would be bad (very error prone).
Why error-prone? ...And if you use text redactor, you always see "length" same color as other functions and non-barewords.
>> So you'd rather have $array[i][j-1]?
Yes, it would increase readability (if there are many indices, and nested). But sure, I can't suggest anything better.
>> You can: $i > 5 or do {print "No"; last}.
Thanks, I haven't used "... or do ...", but I can't understand why language has two different constructs ("{...}" with and without "do"), and I remembered strange thing about such blocks - that you can't use last (and friends) to escape unless you use {{double block}} (one more exception rule).
>> What did you expect to get from $x = "a"; $x++?
"b". I expect to get "a", if statement would be ($x++)--. I think that if Perl differentiates numerical and string operations writing them by punctuations and letters (e.g. firstly I started to use binary: cmp, le, eq, ne,... and <, =, >=, +, -,...), then it could use something different for string and numeral increment, for example: ++ for numeral, and "up" for string, -- for numeral, "dn"/"dw"/"down" for string.
>> The parser is insanely complicated already, besides what would print 1 + foo(1+1)*2; mean then?
It could be a rule of syntacsis, that function take ALL things till the closing paren (w/o opening paren) or thing that is less tight (or/and). So answer for example would be "print 1 + foo 4", and if we would like to have foo eaten only "(1+1)", then we should write "print 1 + (foo 1+1) * 2". With this rule we could everytime omit the outermost pair of parens.
In reply to Re^2: Opinion: where Perl5 wasn't attractive for me
by rsFalse
in thread Opinion: where Perl5 wasn't attractive for me
by rsFalse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |