X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlmodlib.pod;h=c1f4aca6bec9f0cff20d8753524c6ac8fe4ca4e3;hb=9f1b1f2d9ab55954ee07a14c4ab04bd3dd1f99d5;hp=f4331c332493a984356ed6adcce51f5ac50aa8c5;hpb=6cecdcac8975bfe2a12272798634919e91b189db;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlmodlib.pod b/pod/perlmodlib.pod index f4331c3..c1f4aca 100644 --- a/pod/perlmodlib.pod +++ b/pod/perlmodlib.pod @@ -1120,7 +1120,9 @@ scheme as the original author. =item Try to design the new module to be easy to extend and reuse. -Always use B<-w>. +Try to C (or C). +Remember that you can add C to individual blocks +of code that need less warnings. Use blessed references. Use the two argument form of bless to bless into the class name given as the first parameter of the constructor, @@ -1150,8 +1152,8 @@ Generally you can delete the C part with no harm at all. Let the objects look after themselves! Generally, avoid hard-wired class names as far as possible. -Avoid C<$r-EClass::func()> where using C<@ISA=qw(... Class ...)> and -C<$r-Efunc()> would work (see L for more details). +Avoid C<< $r->Class::func() >> where using C<@ISA=qw(... Class ...)> and +C<< $r->func() >> would work (see L for more details). Use autosplit so little used or newly added functions won't be a burden to programs that don't use them. Add test functions to @@ -1208,7 +1210,7 @@ or nature of a variable. For example: $no_caps_here function scope my() or local() variables Function and method names seem to work best as all lowercase. -e.g., C<$obj-Eas_string()>. +e.g., C<< $obj->as_string() >>. You can use a leading underscore to indicate that a variable or function should not be used outside the package that defined it. @@ -1224,7 +1226,7 @@ export try to use @EXPORT_OK in preference to @EXPORT and avoid short or common names to reduce the risk of name clashes. Generally anything not exported is still accessible from outside the -module using the ModuleName::item_name (or C<$blessed_ref-Emethod>) +module using the ModuleName::item_name (or C<< $blessed_ref->method >>) syntax. By convention you can use a leading underscore on names to indicate informally that they are 'internal' and not for public use.