Skip to content

Commit

Permalink
Renumbered =head tags for chapters (GH chromatic#102).
Browse files Browse the repository at this point in the history
  • Loading branch information
chromatic committed Sep 1, 2010
1 parent 07f4cbd commit a7b7353
Show file tree
Hide file tree
Showing 66 changed files with 299 additions and 299 deletions.
14 changes: 7 additions & 7 deletions sections/advanced_oo.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head2 Advanced OO Perl
=head1 Advanced OO Perl

Z<advanced_oo>

Expand All @@ -8,7 +8,7 @@ abstraction also offer possibilities for obfuscation. Only practical
experience can help you understand the most important design techniques... but
several principles can guide you.

=head3 Favor Composition Over Inheritance
=head2 Favor Composition Over Inheritance

Novice OO designs often overuse inheritance. It's common to see class
hierarchies which try to model all of the behavior for entities within the
Expand All @@ -27,7 +27,7 @@ roles) improves encapsulation and reduces the possibility that any one class or
role will grow to do too much. Smaller, simpler, and better encapsulated
entities are easier to understand, test, and maintain.

=head3 Single Responsibility Principle
=head2 Single Responsibility Principle

When you design your object system, model the problem in terms of
responsibilities, or reasons why each specific entity may need to change. For
Expand All @@ -42,7 +42,7 @@ may have a C<Job>-sharing arrangement, for example.)
When each class has a single responsibility, you can improve the encapsulation
of class-specific data and behaviors and reduce coupling between classes.

=head3 Don't Repeat Yourself
=head2 Don't Repeat Yourself

Complexity and duplication complicate development and maintenance activities.
The DRY principle (Don't Repeat Yourself) is a reminder to seek out and to
Expand All @@ -56,7 +56,7 @@ This principle helps to reduce the possibility that important parts of your
system can get unsynchronized, and helps you to find the optimal representation
of the system and its data.

=head3 Liskov Substitution Principle
=head2 Liskov Substitution Principle

The Liskov substitution principle suggests that subtypes of a given type
(specializations of a class or role or subclasses of a class) should be
Expand All @@ -72,7 +72,7 @@ objects with C<PecanPie> objects in the test suite, and everything should
passN<See Reg Braithwaite's "IS-STRICTLY-EQUIVALENT-TO-A" for more details,
U<http://weblog.raganwald.com/2008/04/is-strictly-equivalent-to.html>.>.

=head3 Subtypes and Coercions
=head2 Subtypes and Coercions

Z<subtypes>
Z<coercions>
Expand All @@ -88,7 +88,7 @@ specify mechanisms by which to coerce data of one type to data of another type.

See C<Moose::Util::TypeConstraints> and C<MooseX::Types> for more information.

=head3 Immutability
=head2 Immutability

Z<immutability>

Expand Down
8 changes: 4 additions & 4 deletions sections/anonymous_functions.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head2 Anonymous Functions
=head1 Anonymous Functions

Z<anonymous_functions>

Expand All @@ -11,7 +11,7 @@ references to it--it can do anything a named function can do. The difference
is that it has no name. You always deal with anonymous functions by reference
(see L<references> and L<function_references>).

=head3 Declaring Anonymous Functions
=head2 Declaring Anonymous Functions

You may never declare an anonymous function on its own; you must construct it
and assign it to a variable, invoke it immediately, or pass it as an argument
Expand Down Expand Up @@ -113,7 +113,7 @@ function parameters:

=end programlisting

=head3 Anonymous Function Names
=head2 Anonymous Function Names

X<anonymous functions; names>

Expand Down Expand Up @@ -204,7 +204,7 @@ Calling C<subname()> on C<$anon> and returning into C<$named> modifies that
function, so any other reference to this function will see the same name
C<pseudo-anonymous>.

=head3 Implicit Anonymous Functions
=head2 Implicit Anonymous Functions

X<anonymous functions; implicit>

Expand Down
14 changes: 7 additions & 7 deletions sections/arrays.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head2 Arrays
=head1 Arrays

Z<arrays>
X<arrays>
Expand All @@ -17,7 +17,7 @@ The C<@> sigil denotes an array. To declare an array:

=end programlisting

=head3 Array Elements
=head2 Array Elements

X<variant sigils>
X<sigils; variance>
Expand Down Expand Up @@ -101,7 +101,7 @@ You can resize an array by assigning to C<$#>. If you shrink an array, Perl
will discard values which do not fit in the resized array. If you expand an
array, Perl will fill in the expanded values with C<undef>.

=head3 Array Assignment
=head2 Array Assignment

You can assign to individual positions in an array directly by index:

Expand Down Expand Up @@ -174,7 +174,7 @@ version of C<my @items>. Prefer the latter.

=end sidebar

=head3 Array Slices
=head2 Array Slices

X<array slice>
X<slices; array>
Expand Down Expand Up @@ -232,7 +232,7 @@ used as its index:

=end programlisting

=head3 Array Operations
=head2 Array Operations

Managing array indices can be a hassle. Because Perl 5 can expand or contract
arrays as necessary, the language also provides several operations to treat
Expand Down Expand Up @@ -298,7 +298,7 @@ other operators are shorter and simpler to read and understand.
Arrays often contain elements to process in a loop; see L<looping_directives>
for more detail about Perl 5 control flow and array processing.

=head3 Arrays and Context
=head2 Arrays and Context

X<list context; arrays>

Expand Down Expand Up @@ -347,7 +347,7 @@ not I<create> lists in these circumstances--they only group expressions.
The solution to this flattening behavior is the same for passing arrays to
functions and for creating nested arrays (L<references>).

=head3 Array Interpolation
=head2 Array Interpolation

X<array interpolation>
X<interpolation; arrays>
Expand Down
6 changes: 3 additions & 3 deletions sections/attributes.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head2 Attributes
=head1 Attributes

Z<attributes>

Expand All @@ -15,7 +15,7 @@ they I<can> offer compelling benefits of maintenance and clarity.

=end sidebar

=head3 Using Attributes
=head2 Using Attributes

In its simplest form, an attribute is a colon-preceded identifier attached to a
variable or function declaration:
Expand Down Expand Up @@ -68,7 +68,7 @@ The Catalyst web framework also uses attributes to determine the visibility and

=end sidebar

=head3 Drawbacks of Attributes
=head2 Drawbacks of Attributes

X<pragmas; attributes>
X<attributes.pm>
Expand Down
10 changes: 5 additions & 5 deletions sections/autoload.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head2 AUTOLOAD
=head1 AUTOLOAD

Z<autoload>

Expand Down Expand Up @@ -39,7 +39,7 @@ C<AUTOLOAD()> to emit a message to demonstrate this:

=end programlisting

=head3 Basic Features of AUTOLOAD
=head2 Basic Features of AUTOLOAD

The C<AUTOLOAD()> function receives the arguments passed to the undefined
function in C<@_> directly. You may manipulate these arguments as you like:
Expand Down Expand Up @@ -104,7 +104,7 @@ Finally, whatever C<AUTOLOAD()> returns, the original call receives:
So far, these examples have merely intercepted calls to undefined functions.
You have other options.

=head3 Redispatching Methods in AUTOLOAD()
=head2 Redispatching Methods in AUTOLOAD()

X<AUTOLOAD; redispatch>
X<AUTOLOAD; delegation>
Expand Down Expand Up @@ -143,7 +143,7 @@ it dereferences the proxied object from a blessed scalar reference, extracts
the name of the undefined method, then invokes the method of that name on the
proxied object, passing the given arguments.

=head3 Generating Code in AUTOLOAD()
=head2 Generating Code in AUTOLOAD()

X<AUTOLOAD; code installation>

Expand Down Expand Up @@ -215,7 +215,7 @@ This has the same effect as invoking C<$method> directly, except that
C<AUTOLOAD()> will no longer appear in the list of calls available from
C<caller()>, so it looks like the generated method was simply called directly.

=head3 Drawbacks of AUTOLOAD
=head2 Drawbacks of AUTOLOAD

Z<autoload_drawbacks>

Expand Down
6 changes: 3 additions & 3 deletions sections/barewords.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head2 Barewords
=head1 Barewords

Z<barewords>

Expand All @@ -23,7 +23,7 @@ for good reason.

Even so, barewords are permissible in several places in Perl 5 for good reason.

=head3 Good Uses of Barewords
=head2 Good Uses of Barewords

X<barewords; pros>
X<hashes; bareword keys>
Expand Down Expand Up @@ -118,7 +118,7 @@ bareword; Perl 5 knows everything it needs to know to parse all occurrences of
that function appropriately. Note that all of the drawbacks of prototypes
still apply.

=head3 Ill-Advised Uses of Barewords
=head2 Ill-Advised Uses of Barewords

X<barewords; cons>

Expand Down
10 changes: 5 additions & 5 deletions sections/blessed_references.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head2 Blessed References
=head1 Blessed References

Z<blessed_references>

Expand Down Expand Up @@ -149,7 +149,7 @@ thing with regard to encapsulation as well as genericity.

=end sidebar

=head3 Method Lookup and Inheritance
=head2 Method Lookup and Inheritance

X<method dispatch>
X<objects; methods>
Expand Down Expand Up @@ -255,7 +255,7 @@ behavior with method dispatch. Enable it in your class with:
Unless you're writing a complex framework with multiple interoperable plugins,
you likely never need to use this.

=head3 AUTOLOAD
=head2 AUTOLOAD

X<AUTOLOAD>
X<objects; AUTOLOAD>
Expand All @@ -270,7 +270,7 @@ for more details.
As you might expect, this can get quite complex in the face of multiple
inheritance and multiple potential C<AUTOLOAD> targets.

=head3 Method Overriding and SUPER
=head2 Method Overriding and SUPER

You may override methods in the default Perl 5 OO system as well as in Moose.
Unfortunately, core Perl 5 provides no mechanism for indicating your I<intent>
Expand Down Expand Up @@ -310,7 +310,7 @@ can work around this for you. Moose handles it nicely as well.

=end sidebar

=head3 Strategies for Coping with Blessed References
=head2 Strategies for Coping with Blessed References

Avoid C<AUTOLOAD> where possible. If you I<must> use it, use forward
declarations of your functions (L<functions>) to help Perl know which
Expand Down
2 changes: 1 addition & 1 deletion sections/builtins.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 Builtins
=head0 Builtins

Z<style>

Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_00.pod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ full understanding of Perl.

You can learn this too.

=head1 Running Modern Perl
=head0 Running Modern Perl

You don't have to install a new version of Perl to take advantage of most of
this book, but the examples given assume that you're using Perl 5.10 or newer.
Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_01.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 The Perl Philosophy
=head0 The Perl Philosophy

Perl is a language for getting things done. It's flexible, forgiving, and
malleable. In the hands of a capable programmer, it can perform almost any
Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_02.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 Perl and Its Community
=head0 Perl and Its Community

One of Larry's main goals for Perl 5 was to encourage Perl development and
evolution outside the core distribution. Perl 4 had several forks, because
Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_03.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 The Perl Language
=head0 The Perl Language

The Perl language has several smaller parts which combine to form its syntax.
Unlike spoken language, where nuance and tone of voice and intuition allow
Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_04.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 Operators
=head0 Operators

Z<operators>
X<operators>
Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_05.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 Functions
=head0 Functions

X<function>
X<subroutine>
Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_06.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 Regular Expressions and Matching
=head0 Regular Expressions and Matching

Z<regular_expressions>

Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_07.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 Objects
=head0 Objects

Writing large programs requires more discipline than writing small programs,
due to the difficulty of managing all of the details of your program
Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_08.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 Stylish Perl
=head0 Stylish Perl

Programming and programming I<well> are related, but distinct skills. If we
only wrote programs once and never had to modify or maintain them, if our
Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_09.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 Writing Real Programs
=head0 Writing Real Programs

Z<writing_real_programs>

Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_10.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 Perl Beyond Syntax
=head0 Perl Beyond Syntax

Perl 5 is a large language, like any language intended to solve problems in the
real world. Effective Perl programs require more than mere understanding of
Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_11.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 What to Avoid
=head0 What to Avoid

Perl 5 isn't perfect. Some features seemed like good ideas at the time, but
they're difficult to use correctly. Others don't work as anyone might expect.
Expand Down
2 changes: 1 addition & 1 deletion sections/chapter_12.pod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=head1 What's Missing
=head0 What's Missing

Perl 5 isn't perfect, at least as it behaves by default. Some options are
available in the core. More are available from the CPAN. Experienced Perl
Expand Down
Loading

0 comments on commit a7b7353

Please sign in to comment.