laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Nah, barely. The line of code just shows what Perl is good at: using minimalist building blocks, combining into something actually meaningful. In itself, the ternary operator ?: is not so surprising. It makes its appearance in many languages, such as C, C++, C# (I believe), Obj-C (I believe), Java (I believe), JavaScript, and likely many more. Statement modifiers also aren't very mention-worthy, in that many languages in the C-family allow you to
Whereas Perl requires the curly braces around it:
But not if you write it as
So statement modifiers are just one of those things in Perl's syntax that make Perl Perl, however it's not something we don't know in one form or another from other languages. In reply to Re^7: how to deal with incorrect command line argument
by muba
|
|