3 ms·
>print ... also accepts expressions as arguments It's true for all perl functions. Unusual part, if I got you right, is that parenthesis are optional in perl.
by wruza 7y ago
>print ... also accepts expressions as arguments
It's true for all perl functions. Unusual part, if I got you right, is that parenthesis are optional in perl. So, this:
foo bar "\n", @baz;
is equivalent to:
foo(bar("\n", @baz));
(unless bar has ($) prototype, anyway; but then it all gets ambiguous)
- SwellJoe 7y agoMostly I was just saying that `say` isn't the interesting bit of the examples given. But, sure, Perl is nice in how flexible/expressive it is (and Perl 6 takes that even further). I think maybe that's even the most interesting thing about the article. I mean, the date math is super cool and impressive and elegant, but the various paradigm examples is maybe more fun for me, since munging dates is rarely a thing I do. TIMTOWTDI can get out of hand, at times, but it's really nice to have such beautiful concise ways to solve a problem in OO, functional, parallel, etc. styles all of which are very readable and quite concise.