5 ms·
I suggest "Perl Nukem Forever"
by jpm_sd 7y ago
I suggest "Perl Nukem Forever"
- DonHopkins 7y agoPerhaps something onomatopoeic like "$#_@;\>&%}`[*~!^)"
- coldpie 7y agoAs a non-perl programmer, the mnemonic descriptions in the perlvar manpage crack me up. They probably are useful and make sense to perl programmers, but from the outside, they look like parody.
- DonHopkins 7y agoThe whole "Perl is easy to learn because it borrows from other languages" argument is based on a very specific set of historical assumptions about which "other languages" everybody knows, and what associations they have with each punctuation character from different shells and languages and utilities and operating systems and config files circa 1987, that is just totally obsolete these days.
- jandrese 7y agoBash still uses the same variable names. Are you saying nobody writes shell scripts anymore? Plus, you can always "use English;" if you want less cryptic names.
- DonHopkins 7y agoBash didn't exist when Perl was invented in 1987. Bash was first released two years later in 1989. In 1987 there was the Bourne shell sh, and there was csh and derivatives like tcsh, and there was the Korn shell ksh and its derivatives, and they each had their own unique quirky menageries of subtly nuanced punctuation and syntax and variable names. And of course there was sed, and awk, and C, and even BASIC.
- boring_twenties 7y agoMost if not all of the variables in question come from the Bourne shell. It's fair to mention bash still using them today because it's supposed to be Bourne's successor.
- nocman 7y agoI don't think you should place too much emphasis/concern/whatever on most of the special variables available in Perl 5. I would wager that most Perl programmers never use about 95% of them (that is, the short 2-3 character ones listed on that man page). At the very least, I would guess, most Perl programmers almost never use 95% of them -- and many would choose (as the perlvar man page says) to 'use English;' -- and thus use the readable version. An example would be using $LIST_SEPARATOR instead of $" (which is what I would do). I write Perl 5 code frequently, and that man page is chock full of short variable names I never use.
- Grinnz 7y agoIn practice (from a rough survey of CPAN code and Perl code in the wild I've looked at), people rarely use the English versions, and tend to memorize the few punctuation variables that are commonly used: $_, @_, $/, $], $$, $@, $!, $? (and note that some of these are out of familiarity with other languages) and ignore the rest unless needed for a specific problem.
- nocman 7y agoThis is probably accurate. I personally use this subset all of the time (for reasons that will be obvious to Perl programmers): $_, @_, $@, $!, $? I have occasion to use $$, but not too often. I tend not to use much else, and like others have said in this thread, I just look up things that I need when I need them. If it is not obvious what something does (especially if it is one of these special variables), I will add a comment to explain (as I would in any programming language I use). I understand why people don't like this particular characteristic of Perl, and it is a legitimate thing to have differing tastes. But I don't personally find it to be anywhere near as "end of the world" awful as many people who can't stand Perl make it out to be.
- DonHopkins 7y agoYet you have to know both versions of them all, and be able to recognize and understand both kinds when reading other people's code. How does it improve the language to be so top-heavy and chock-full of obscure unreadable arbitrary syntax, 95% of which nobody every uses, but that everyone still needs to memorize and understand in order to read? That's exactly why Perl's philosophy of TMTOWTDI is intellectually bankrupt, and encourages write-only "creative snowflake" Perl code that's an inscrutable, unreadable, unmaintainable nightmare. The language isn't any better for having $" as a shortcut for $LIST_SEPARATOR (or $LIST_SEPARATOR as a mnemonic for $", depending on how you look at it), because now you have to learn twice as many things, and all that duplicated effort and mental stress and syntactic surface area doesn't make it any more powerful or easy to use, has absolutely no tangible benefits, only pointless costs, and makes it twice as hard to learn and read and maintain Perl code.
- smueller1234 7y agoThey're a holdout from a different time. Think 30 years and having an obvious root in shell scripting. They make sense to shell users coming to Perl. No more or less.