Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
"We believe there are no stupid questions, just stupid answers."

Not to be overly critical, but I really don't like that line. The "just stupid answers" part might discourage people from answering questions, or give them the impression that we're a bunch of jerks who aren't really funny. I personally can't think of an ending that I really like on it, though I would like some really funny catch phrase.

I would turn #4 into the following:

4. Please, please, please use the following

Study these these pragmas and try putting them in your code. They help pinpoint errors, and give explanations about what's wrong, and might even explain how to fix it.
#!/usr/bin/perl -w # Equivalent to use warnings; see below.
use strict;        # Enforces safer, clearer code.
use warnings;      # Detects common programming errors 
use diagnostics;   # Explains how to fix alerts from use warnings;

use strict; is useful mostly because, like in C or Java, it forces you to declare all your variables before use. This eliminates errors from misspelled variables and encourages the programmer to structure his/her program clearly. It also prevents some tricky things with references and subroutines.

use warnings; (or almost equivalently the -w command line switch) and use diagnostics; are closely related pragmas. use warnings; detects a ton of non-fatal errors caused by syntax mistakes, context misperceptions, etc... use diagnostics; can usually tell you how to fix these problems. These two pragmas especially benifit those new to Perl who are not yet familiar with Perl's idiosyncracies.

Update: I would provide the basic definitions here because getting a new user to start reading Perl's massive amounts of not particularly intuitive documentation is asking quite a lot. Start them out slowly, while they're still feeling their way around.

In reply to Re: New Monks Info Page by Lexicon
in thread New Monks Info Page by tachyon

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, 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, 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.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (9)
    As of 2020-11-23 22:51 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found