Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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


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

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2023-03-25 14:50 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (63 votes). Check out past polls.