<FONT face="Default Sans Serif, Verdana, Arial, Helvetica, sans-serif" size=2><DIV><FONT face="OCR A Extended">1) variable names<BR>Just saw at the O'Reilly OSCON site that mixed case is called "CamelCase"</FONT></DIV><DIV><FONT face="OCR A Extended">(from the wiki, which has great links to the slides etc. from many of the presentations:</FONT></DIV><DIV><A href="http://wiki.oreillynet.com/oscon/index.cgi" target=blank>http://wiki.oreillynet.com/oscon/index.cgi</A></DIV><DIV>though not D. Conway's "Style" or his other sessions). Personally, I use all lower case and underscores for vars but balk at $the_last_counter_for_session_resets sort of wordy-ness. One, maybe 2 underscores at most. Camelcase seems less readable or ... less something, for vars.</DIV><DIV><FONT face="OCR A Extended">2) function names</FONT></DIV><DIV><FONT face="OCR A Extended">Functions I can live w/ a mixed case, or even any use of initial/any upper case. It can help distinguish the first glance parsing (akin to "shorts for sex" - much as I hate to admit it, that's the parse I saw too) of code function/var-wise.<BR>3) the "{" after a function</FONT></DIV><DIV><FONT face="OCR A Extended">I always put it on a line by itself. I try to always comment the matching close curly:</FONT></DIV><DIV><FONT face="OCR A Extended">sub foo</FONT></DIV><DIV><FONT face="OCR A Extended">{</FONT></DIV><DIV><FONT face="OCR A Extended">...</FONT> </DIV><DIV><FONT face="OCR A Extended">} # sub foo</FONT><BR></DIV><DIV>likewise, close for/while/if/else close curlies get comments</DIV><DIV>if ( $foo =~ /bar/ ) {</DIV><DIV>...</DIV><DIV> } else { # if foo =~/bar/</DIV><DIV>...</DIV><DIV>} # if foo =~ /bar/</DIV><DIV> </DIV><DIV>while (<>) {</DIV><DIV>...</DIV><DIV>} # while <></DIV><DIV> </DIV><DIV>etc. I try to put the curly on the same line as the if, unless there's multiple conditionals, and bracket/"kiss" an "else" but, if there's 2 or more conditional clauses, I try to re-think the block. Generally speaking I do something unsupportable like:</DIV><DIV>if ( ($foo and $foo eq "bar") </DIV><DIV> or ($baz and $baz > 3) </DIV><DIV> ) {</DIV><DIV>but more often I find it often means I'm mushing $foo and $baz together improperly. Linked as they may seem at the moment (esp. if you add a $bum in there) growth will bring up the case where $foo eq bar but $baz < 3. Not necessarily pretty or efficient but:</DIV><DIV>if ( $foo and $foo eq "bar" ) {</DIV><DIV> if ( $baz and $baz > 3 ) {</DIV><DIV> ...</DIV><DIV> } else { # if baz > 3</DIV><DIV> ...</DIV><DIV> } # if baz > 3</DIV><DIV>} else { # if foo eq bar</DIV><DIV> ... # may include $baz tests, duplicates even</DIV><DIV>} # if foo eq bar<BR></DIV><DIV>and, of course, building debug and debug levels in at creation time:</DIV><DIV>my $debug = 10;</DIV><DIV>while (<>) {</DIV><DIV> print STDERR "Got: $_" </DIV><DIV> if $debug > 8;</DIV><DIV> if ( /tcp (.*) found/ ) {</DIV><DIV> print STDERR "TCP: $1\n"</DIV><DIV> if $debug > 4;</DIV><DIV> ...</DIV><DIV> } # if /tcp found/</DIV><DIV> if ( /udp (.*) found/ ) {</DIV><DIV> print STDERR "UDP: $1\n"</DIV><DIV> if $debug > 4;</DIV><DIV> ...</DIV><DIV> } # if /udp found/</DIV><DIV> </DIV><DIV>} # while <></DIV><DIV> </DIV><DIV>Not trying to win converts, just the 'style' (no kahki's, no collared short-sleeve shirts unless I have a meeting, but no ZZ Top beards either) I'm hoping to maintain.</DIV><DIV> </DIV><DIV>a<br><br>Andy Bach, Sys. Mangler<br>Internet: andy_bach@wiwb.uscourts.gov <br>VOICE: (608) 261-5738 FAX 264-5932<br><br>"Whereof we cannot speak, thereof we should remain silent." L. Wittgenstein<BR></DIV></FONT>