|Welcome to the Monastery|
|( #3333=superdoc: print w/replies, xml )||Need Help??|
Perl supports something new and weird, called a script. It's been around for just a few decades, so I understand you have never heard of it before. Essentially, you put your code into a text file instead of insisting to type half a kilobyte of code into the command line over and over again. Start the file with #! followed by the name of the interpreter, in your case /usr/bin/perl, followed by a newline. Put your code into the next lines. See also https://www.in-ulm.de/~mascheck/various/shebang/ and perlrun.
The following quote comes from about the same time:
"I don't comment my code because if it was hard to write, then it should also be hard to read."
Sounds familiar? Yes, disk space and memory once were a scare resource. The MUMPS people learned that the hard way, and so their code typically looks like this, even after more than half of a century has passed:
Great news: We have increased disk space, memory and CPU power by several orders of magnitude since that dark age. You no longer have to fight for every byte. So feel free to add as much comments as you like, explaining whatever is not obvious in your code.
Oh, and by the way: Some clever people invented something called POD, a way to create nice-looking documentation from a few lines of text inserted into your perl code. Other people have copied and extended that idea for other languages, at least twice (Javadoc, Doxygen).
Well, actually, no REAL MUMPS programmer would ever use functions. "We have labels. We don't need no stinkin' functions." And the NEW command is something to avoid at all costs. "Adding scope to variables is for the weeks. We know our variables, and we know when we have to copy then to prevent overwriting." Plus, those lines are way too short. The first three lines should be combined into one. "Stuffing as much code into a line as possible makes the code run faster. The interpreter is line-based."
(And no, I did not make up these quotes. They are real, from a time when I had to write MUMPS code for a living - in THIS century.)
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In reply to Re^3: List EXE_FILES installed by CPAN