Ok. That code makes no sense. Let's disect it:
- my VAR ... This creates a lexical variable within the innermost scope you're in. In this case, it creates an array called @d.
- = ... assignment operator (but, you knew that)
- sort LIST ... Takes a list (or array which it converts to a list, but that's unimportant) which can be named or unnamed. In this case, it takes a list called @d, which has to have been defined earlier (at least, for it to make sense).
Now, you
can do something like
@d = sort @d; which basically means that you want to do an ASCII
sort the values within @d and then store the result within @d. But, by having the
my there, it doesn't make any sense.
If you put -w on your shebang line, you'd see a redefinition of @d warning.
As for it being unPerl-like, it's not. You may be used to a lot of in-place operators, and that's not C-like. But, sort doesn't work in-place, primarily because you often want to sort an array, then put the sorted result into another array.
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.