From perlrun:

-w
prints warnings about variable names that are mentioned 
only once, and scalar variables that are used before being 
set. Also warns about redefined subroutines, and references 
to undefined filehandles or filehandles opened read-only 
that you are attempting to write on. Also warns you if you 
use values as a number that doesn't look like numbers, 
using an array as though it were a scalar, if your 
subroutines recurse more than 100 deep, and innumerable 
other things. 


You can disable specific warnings using __WARN__ hooks, as 
described in perlvar and perlfunc. See also perldiag and 
perltrap. 

The strict pragma is used to restrict unsafe constructs. There are 'refs', 'vars', and 'subs'. You can simply do 'perldoc strict' to see the POD, but in a nutshell, 'refs' makes sure you don't use symbolic references, 'vars' ensures you always predeclare your variables (and are declared in scope), and 'subs' makes sure you do not use a bareword unless it is in curlies {}, or is on the left side of =>. Likely, the example code does something that either -w or strict doesn't like. You can turn off one of the three pieces of strict like so:

no strict 'refs';

For example. Sometimes this comes up when some module isn't very strict friendly (sometimes I run across this when using filehandles for certain graphic manipulation modules). If you have warning turned on, and are about to do something that is not -w friendly, you can turn them off with:

$^W = 0;

and back on by setting it back to 1. I hope this quick rundown helps a bit.

Cheers,
KM


In reply to Re: use strict by KM
in thread use strict by Ignorance

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.