3 ms·
There is nothing particularly magical about $_. It is merely a global variable that is optionally used implicitly in various builtins, as well as scope-localize
by Mithaldu 11y ago
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.
- lmm 11y agoAre you sure you're not just used to it? The description you've just given sounds very magic to me.
- Mithaldu 11y agoThat 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.