News for hackers. Stuff that matters.
Re:Why Perl 6 is Different (2010) by htns on Tuesday January 12, 2016 @12:06PM (#10888611)
Scala uses [$]_ in very similar ways and everyone loves it.
Re:Why Perl 6 is Different (2010) by lmm on Tuesday January 12, 2016 @12:19PM (#10888720)
"_" in Scala is not a magic variable like in Perl. It's a very mechanical syntax transformation, it just expands to "x => x" (or equivalent, and without colliding with any "x" that's already defined).

In practice maybe the use is similar. But having a comprehensible theoretical model makes all the difference in terms of making sure you can actually read the code and understand what will happen.

Re:Why Perl 6 is Different (2010) by Mithaldu on Tuesday January 12, 2016 @05:45PM (#10890997)
There is nothing particularly magical about $_. It is merely a global variable that is optionally used implicitly in various builtins, as well as scope-localized by loop control constructs.
Re:Why Perl 6 is Different (2010) by lmm on Wednesday January 13, 2016 @05:20AM (#10893383)
Are you sure you're not just used to it? The description you've just given sounds very magic to me.
Re:Why Perl 6 is Different (2010) by Mithaldu on Wednesday January 13, 2016 @12:31PM (#10895954)
That depends on how you define "magic". I typically do so as "cannot be implemented in the language itself", which does not apply to $_, as it can be reimplemented in Perl itself. If i was bored enough i could create a module that sets up a $this variable that acts exactly the same, in pure perl.