3 ms·
I would never use them in my code. The problem is when I'm debugging 5 year old code it becomes such a headache.
by typon 11y ago
I would never use them in my code. The problem is when I'm debugging 5 year old code it becomes such a headache.
- arethuza 11y agoI thought that the point of $_ was that you don't reference it directly in your code?
- Mithaldu 11y agoIt is! But sometimes you end up using it to make code more reliable, as in: do_thing($_) for @things; Where $_ is passed in as an argument, as opposed to: do_thing for @things; Where $_ is (due to its global nature) set by `for`, and read in sub do_thing { ... }
- Mithaldu 11y ago> I would never use them in my code. Most people don't. The only one that is used a lot is @_. :) As for debugging old code, that's why i pointed out perlvar. It's never far and it's always easy to look up what a specific var does.
- typon 11y agoWell I end up doing that of course, but I'm just complaining that it gets really annoying really fast seeing all these dollar signs peppered in the code, making it super unreadable.