Skip to content

Commit

Permalink
Improved line and pagebreaking for chapter 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
chromatic committed Dec 7, 2011
1 parent 6b72ad7 commit 339def8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
15 changes: 7 additions & 8 deletions sections/operator_characteristics.pod
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ X<C<//=>; infix operator>

=over 4

=item I<Infix> operators appear between their operands. Most mathematical
=item * I<Infix> operators appear between their operands. Most mathematical
operators are infix operators, such as the multiplication operator in C<$length
* $width>.

Expand All @@ -161,9 +161,9 @@ X<C<->; prefix operator>
X<C<!>; prefix operator>
X<C<!!>; prefix operator>

=item I<Prefix> operators precede their operators. I<Postfix> operators follow.
These operators tend to be unary, such as mathematic negation (C<-$x>), boolean
negation (C<!$y>), and postfix increment (C<$z++>).
=item * I<Prefix> operators precede their operators. I<Postfix> operators
follow. These operators tend to be unary, such as mathematic negation (C<-$x>),
boolean negation (C<!$y>), and postfix increment (C<$z++>).

X<C<()>; circumfix operator>
X<C<{}>; circumfix operator>
Expand All @@ -173,15 +173,14 @@ X<C<``>; circumfix operator>
X<C<''>; circumfix operator>
X<C<"">; circumfix operator>

=item I<Circumfix> operators surround their operands, as with the anonymous
=item * I<Circumfix> operators surround their operands, as with the anonymous
hash constructor (C<{ ... }>) and quoting operators (C<qq[ ... ]>).

X<C<()>; postcircumfix operator>
X<C<{}>; postcircumfix operator>
X<C<[]>; postcircumfix operator>

=item I<Postcircumfix> operators follow certain operands and surround others,
as seen in hash and array element access (C<$hash{ ... }> and C<$array[ ...
]>).
=item * I<Postcircumfix> operators follow certain operands and surround others,
as seen in hash and array element access (C<$hash{$x}> and C<$array[$y]>).

=back
23 changes: 12 additions & 11 deletions sections/operator_types.pod
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ becomes C<aaa>, and C<a9> becomes C<b0>.

$num++;
$str++;
is( $num, 2, 'numeric autoincrement should stay numeric' );
is( $str, 'b', 'string autoincrement should stay string' );
is( $num, 2, 'numeric autoincrement' );
is( $str, 'b', 'string autoincrement' );

no warnings 'numeric';
$num += $str;
$str++;

is( $num, 2, 'adding $str to $num should add numeric value of $str' );
is( $str, 1, '... but $str should now autoincrement its numeric part' );
is( $num, 2, 'numeric addition with $str' );
is( $str, 1, '... gives $str a numeric part' );

=end programlisting

Expand All @@ -245,23 +245,24 @@ it produces a string consisting of the string value of its first operand
concatenated to itself the number of times specified by its second operand.

In scalar context, the operator always produces a concatenated string repeated
appropriately.

For example:
appropriately. For example:

=begin programlisting

my @scheherazade = ('nights') x 1001;
my $calendar = 'nights' x 1001;
my $cal_length = length $calendar;

is( @scheherazade, 1001, 'list repeated' );
is( length $calendar, 1001 * length 'nights', 'word repeated' );
is( @scheherazade, 1001, 'list repeated' );
is( $length, 1001 * length 'nights',
'word repeated' );

my @schenolist = 'nights' x 1001;
my $calscalar = ('nights') x 1001;

is( @schenolist, 1, 'no lvalue list' );
is( length $calscalar, 1001 * length 'nights', 'word still repeated' );
is( @schenolist, 1, 'no lvalue list' );
is( length $calscalar,
1001 * length 'nights', 'word still repeated' );

=end programlisting

Expand Down

0 comments on commit 339def8

Please sign in to comment.