Any dangers to putting "my" on every variable?
Yes, don't do that. When you write your own code from
scratch, you can write it to use all lexical variables,
but if you try to retrofit that onto code that wasn't
written that way you can get strange results. The
"always use strict" advice only applies to new work;
you shouldn't try to retrofit it to someone else's
code. At least, not until you're confident you know
what you're doing.
Warnings you should use. Now, for cgi you don't want
warnings on for production use, because they'll mess up
the interaction between the script, the web server, and
the browser. So you can either test from the command
line, or use one of the modules that sends errors and
warnings to the browser. Or you can turn on warnings
while you're debugging and turn them off again after,
which is probably what I'd do. You do know how to
tail web server logs, right?
My long-term advice to you is to plan on
gradually
rewriting the whole thing (or most of it) yourself, in
bits and pieces.
You'll have an easier time maintaining it that way.
But you don't have time to do that all at once right
now, so only write the bits you need to write in order
to meet your deadline. Later you'll want to add or
change more things, and you can (re)write more parts
of it at that time.
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
-
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.
|