Question #1: Does anyone have any favorite document
that is a style guide for perl programmers? There are
entire books on the subject of style for C++
programmers, I've not seen any for perl, though.

I'm in the unfortunate position of being a lone
programmer on a Perl project. I've taught myself perl
with the help of Wall's book and this mailing list and
I've had to learn some pretty painful lessons. The
code I've inherited has mostly taught me what NOT to
do. (sigh).

Question #2: Is this bad style?

my $q = new CGI;
my ($v1, $v2, $v3) = ($q->param("arg1"),
$q->param("arg2"), $q->param("arg3"));

I think so. If arg1 is missing, $v1 gets arg2. I hate
that feature! It stinks! I'm inclined to abandon
declaring multiple variables in a single statement as
a matter of general principle. What is your opinion?

Question #3: How big should my modules be? I inherited
3000 line modules. I noticed I spend A LOT of time
matching up braces in modules this large. Do I pay a
performance penalty if I have dozens of different
modules for a cgi program?

Question #4: These statements terrify me:
my @x = (1, 2, 3); 
$Case->{xyz} = [EMAIL PROTECTED];
print $Case->{xxyz}[0]; # Typos!

Is there anyway to get a syntax error when I type
"xxyz" when I intended to type "xyz"? I don't believe
"use warn" or "use strict" help me here.

Are hashes the only counterpart to C structs? It seems
to me perl needs the struct feature that will give me
a syntax error when I reference a field that does not
exist.

Question #5: I don't understand prototyping in perl.
Will prototyping in Perl help detect syntax errors the
same way protyping in C will help detect syntax
errors?

  Thanks for all your help!
         siegfried

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to