Okay, I've been around for three days and already saw quite a number of questions that could be answered with 'use strict;' and 'add -w to your command line'. In fact, most of those wisdom seekers could solve their problems just by reading FAQs -- turns out that there are monks who don't read TFMs. How surprising ;-)
Anyway, perhaps something like this could help some new perl users. I apologize for the quality -- me be jussa foreigner ;-)
Do I really have to tell you what tune to sing this filk to?
Cheer up, brother,
You know what they say.
Some things you code are bad,
They can really make you mad,
Other things just make you swear and curse,
When you're coding into morning,
Don't grumble, turn on warnings!
And this'll help things turn out for the best...
And...
...always code in the strict mode of perl
(whistle)
...always code in the strict mode of perl
If Perl seems to be broken,
There's something you've forgotten!
And that might be quite hard to find indeed,
When you're feeling in the dumps,
Don't be silly chumps,
Just add two lines when coding -- that's the thing!
And...
...always code in the strict mode of perl
(whistle)
Come on!
...always code in the strict mode of perl
(whistle)
Perl can act quite absurd,
But has the final word,
No sense saying that you're right when it says no.
Just let it do its job -- use strict and 'w' flag,
And sit back -- it's the easiest way we know!
So... always code in the strict mode of perl,
It's the first advice you will ever get,
Perl finds typos quick,
And is quite good at it,
Just let it know that you want it to.
You'll see it really worked,
Just try it and you're hooked.
Just remember that the time it saves is yours!
And always code in the strict mode of perl,
(whistle)
Always code in the strict mode of perl,
(whistle)
-mk
In reply to strict
by marcink
-
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.
|