3 ms·
Yes, I think so. I recently had to explain to someone what "_" means in Perl (not to be confused with $_ or @_). It was simple for me to answer, because I had
by makecheck 17y ago
Yes, I think so.
I recently had to explain to someone what "_" means in Perl (not to be confused with $_ or @_). It was simple for me to answer, because I had the experience. But someone seeing it for the first time wouldn't exactly be able to Google it, or look it up in a man page; who would think to look for it under "perldoc -f stat"? What's more, this particular short-cut, while useful, has a side effect: if someone maintaining the code inserts a stat on a different file in between the original stat and the "_", then the source of the "_" changes. For a single character in a script, that's a heck of a lot of barriers for a new programmer.
- gaius 17y agoPerl has demonstrated itself to be an effective tool for experienced sysadmins to write single-purpose or throwaway scripts, but applications spend most of their lives in maintenance. It it always a false economy to make things difficult for maintenance programmers, even unintentionally. Pretty much everyone I work with has been burned by being handed some legacy Perl to maintain and as a result we are very reluctant to do any new work with it. The payoff for rewriting in Python is that the technical debt incurred for using Perl in the first place is repaid.
- chromatic 17y agoI think your first paragraph contains a non sequitur. The existence of the strict and warnings pragmas, Perl::Critic, Perl::Tidy, Test::More, the size of the bundled perldoc, CPAN testers, CPANTS, et al all contribute to the maintainability of Perl 5 applications. If you choose not to take advantage of those tools when writing a Perl 5 application, you bear the risk yourself. How does that reflect on the language or the ecosystem?
- pfedor 17y agoNot to defend this particular programming idiom, but the third result for [perl underscore] is "About Special Underscore Filehandle" http://www.perlmonks.org/index.pl?node_id=613621 http://www.perlmonks.org/index.pl?node_id=613621 so it's rather easy to Google.