
stas at apache
Sep 18, 2001, 6:52 PM
Post #1 of 1
(302 views)
Permalink
|
|
cvs commit: modperl-docs/src/devel/modperl_style modperl_style.pod
|
|
stas 01/09/18 18:52:03 Modified: src/devel/modperl_style modperl_style.pod Log: style fix Revision Changes Path 1.2 +24 -25 modperl-docs/src/devel/modperl_style/modperl_style.pod Index: modperl_style.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/devel/modperl_style/modperl_style.pod,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- modperl_style.pod 2001/09/17 13:13:05 1.1 +++ modperl_style.pod 2001/09/19 01:52:03 1.2 @@ -99,21 +99,20 @@ Do: my @list = ( - "item1", - "item2", - "item3", - ); + "item1", + "item2", + "item3", + ); Don't: my @list = ( - "item1", - "item2", - "item3" - ); + "item1", + "item2", + "item3" + ); - =item Last Statement in the Block The same goes for C<;> in the last statement of the block. Almost @@ -123,17 +122,17 @@ Do:0 sub foo { - statement1; - statement2; - statement3; + statement1; + statement2; + statement3; } Don't sub foo { - statement1; - statement2; - statement3 + statement1; + statement2; + statement3 } =back @@ -203,12 +202,12 @@ When you do wish to import from a module try to use an explicit list or tag whenever possible, e.g.: - use POSIX qw(strftime); + use POSIX qw(strftime); When you do not wish to import from a module, always use an empty list to avoid any import, e.g.: - use IO::File (); + use IO::File (); (explain how to use Apache::Status to find imported/exported functions) @@ -226,11 +225,11 @@ Do: - CGI::Cookie->new + CGI::Cookie->new Don't: - new CGI::Cookie + new CGI::Cookie =back @@ -287,9 +286,9 @@ Don't: for (1..100) { - ....more than a few statements... - foo(); - .... + ....more than a few statements... + foo(); + .... } Because foo() might change C<$_> if foo()'s author didn't localize C<$_>. @@ -297,9 +296,9 @@ This is OK: for (1..100) { - .... a few statements with no subs called - # do something with $_ - .... + .... a few statements with no subs called + # do something with $_ + .... }
|