I'm kinda feeling this would be better in the Obfuscated Code section. :-/

I feel you. It was a struggle. Is there an easier way to list CPAN EXE_FILES?

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:

Q() N S,N,T,I,K,Q S I="K",S="11",K="l1",Q="R",T="K" I I=T D T Q:$Q Q Q T I I,S&K S S=S+K Q

(Source: Wikipedia)

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.)

Alexander

--
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 by afoken
in thread List EXE_FILES installed by CPAN by usemodperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.