http://www.perlmonks.org?node_id=1067102


in reply to Autoboxing ... "Yes We Can" ( or how I learned to love TIMTOWTDI ;)

Someone much wiser than me once said it is better to remain silent and be thought a fool than to open one's mouth and remove all doubt.

That being said ... I feel compelled to ask the (obvious?) question of what does this buy us? To me, it looks a lot like using postfix notation in a way that does not contribute to making Perl read like English. That is, where next unless $foo > $bar; reads like a sentence in English, @foo->push($bar) doesn't, to me at least. (I should point out that I take strong exception to PBP discouraging postfix notation.)

I think my point can be demonstrated even better when given something like 'Hello, world!'->upper();. There is no need whatsoever for an argument to "upper" in that case. How is that more clear as to intent than upper('Hello, world!');? (I will grant that a modification-in-place such as $foo->upper() might be more concise that $foo = upper($foo), but clarity would still be open to debate, especially given a use-case such as say $foo->upper();.)

I can see where this could be useful for a language that is not as flexible or useful as Perl (i.e. strongly typed languages that resemble a straight-jacket) but I don't see that it adds to Perl other than contributing to (excessive?) code bloat in an effort to add something that Perl might not really need given its existing versatility.

It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.