[Mastering-perl] Patch for typos / spelling errors

Evan A. Zacks e at zacks.org
Wed Jan 17 12:16:21 EST 2007


Hello brian,

Thanks for your work on this book, I'm looking forward to seeing
it in print.

Attached is a patch to fix some minor spelling errors, typos, and
pod formatting. One possible typo I wasn't sure about was in
bin/make_bundle, line 225:

1: xtUtils::MakeMake

Is this supposed to be ExtUtils::MakeMaker? That module appears
on line 88:

8: ExtUtils::MakeMaker

I couldn't find any other reference to xtUtils::MakeMake in the
distribution or on CPAN.

Hope this helps.

Thanks,
-E
-------------- next part --------------
Index: Scripts/Taint/perl-untaintor
===================================================================
--- Scripts/Taint/perl-untaintor (revision 236)
+++ Scripts/Taint/perl-untaintor (working copy)
@@ -6,7 +6,7 @@
my @args = grep { ! /-T/ } @ARGV;

# determine script name. Usually that's the first thing
-# after the swithes (or the '--' which ends switches). This
+# after the switches (or the '--' which ends switches). This
# won't work is the last switch takes an argument, but handling
# that is just a matter of work.
my( $double ) = grep { $args[$_] eq '--' } 0 .. $#args;
Index: Scripts/Taint/hash_keys.pl
===================================================================
--- Scripts/Taint/hash_keys.pl (revision 236)
+++ Scripts/Taint/hash_keys.pl (working copy)
@@ -5,7 +5,7 @@
print "The first argument is tainted\n"
if tainted( $ARGV[0] );

- at ARGV = keys %{ { map { $_, 1 } @AGRV } };
+ at ARGV = keys %{ { map { $_, 1 } @ARGV } };

print "The first argument isn't tainted anymore\n"
unless tainted( $ARGV[0] );
\ No newline at end of file
Index: Scripts/CleansingCode/stunnix-encoded.pl
===================================================================
--- Scripts/CleansingCode/stunnix-encoded.pl (revision 236)
+++ Scripts/CleansingCode/stunnix-encoded.pl (working copy)
@@ -1,6 +1,6 @@
#!/usr/bin/perl

-=head1 SYNOPSYS
+=head1 SYNOPSIS

A small program that does trivial things.

Index: Scripts/CleansingCode/stunnix-do-it-encoded.pl
===================================================================
--- Scripts/CleansingCode/stunnix-do-it-encoded.pl (revision 236)
+++ Scripts/CleansingCode/stunnix-do-it-encoded.pl (working copy)
@@ -1,6 +1,6 @@
#!/usr/bin/perl

-=head1 SYNOPSYS
+=head1 SYNOPSIS

A small program that does trivial things.

Index: Scripts/CleansingCode/stunnix-file-temp.pl
===================================================================
--- Scripts/CleansingCode/stunnix-file-temp.pl (revision 236)
+++ Scripts/CleansingCode/stunnix-file-temp.pl (working copy)
@@ -38,4 +38,4 @@
"\x23\x20" . $zf6f94df7a7 ) ) ; } ; return ( ( length ( $@ ) !=
(0x26d2+ 59-0x270d) ) ) ; } sub z021c43d5f3 { use strict "\x72\x65\x66\x73" ; (
my ( $z0f1649f7b5 , $z9e1f91fa38 ) = each ( %ENV ) ) ; return ( z109276e1f2 (
-$z9e1f91fa38 ) ) ; }
\ No newline at end of file
+$z9e1f91fa38 ) ) ; }
Index: Scripts/Errors/chained-die-propagate.pl
===================================================================
--- Scripts/Errors/chained-die-propagate.pl (revision 236)
+++ Scripts/Errors/chained-die-propagate.pl (working copy)
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# chanined-die-propagate.pl
+# chained-die-propagate.pl
use strict;
use warnings;

Index: Scripts/Errors/chained-die-more-info.pl
===================================================================
--- Scripts/Errors/chained-die-more-info.pl (revision 236)
+++ Scripts/Errors/chained-die-more-info.pl (working copy)
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# chanined-die-more-info.pl
+# chained-die-more-info.pl

eval{
eval {
@@ -14,7 +14,7 @@
my $user = getpwuid( $< );
my $mode = ( stat $file )[2];
$@ .= sprintf "\t%s mode is %o\n", $file, $mode;
- $@ .= sprintf( "\t%s is not writeable by %s\n", $file, $user )
+ $@ .= sprintf( "\t%s is not writable by %s\n", $file, $user )
unless -w $file;
die; # first catch
}
@@ -27,4 +27,4 @@
if( $@ )
{
print "I got $@!"; # finally
- }
\ No newline at end of file
+ }
Index: Scripts/Errors/chained-die-reference.pl
===================================================================
--- Scripts/Errors/chained-die-reference.pl (revision 236)
+++ Scripts/Errors/chained-die-reference.pl (working copy)
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# chanined-die-reference.pl
+# chained-die-reference.pl

eval{
eval {
Index: Scripts/Errors/chained-die.pl
===================================================================
--- Scripts/Errors/chained-die.pl (revision 236)
+++ Scripts/Errors/chained-die.pl (working copy)
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# chanined-die.pl
+# chained-die.pl

eval{
eval {
Index: Scripts/Errors/mac-realplayer.pl
===================================================================
--- Scripts/Errors/mac-realplayer.pl (revision 236)
+++ Scripts/Errors/mac-realplayer.pl (working copy)
@@ -11,7 +11,7 @@
eppc => 'RealPlayer',
$ENV{REALPLAYER_MACHINE},
undef, undef,
- map { $ENV{"REALPLAYER_MACHICE_$_"} } qw( USER PASS )
+ map { $ENV{"REALPLAYER_MACHINE_$_"} } qw( USER PASS )
);

$realplayer->open_clip( with_url => $ARGV[0] );
@@ -20,4 +20,4 @@
{
my $number = $^E + 0;
die "$number: $MacError\n";
- }
\ No newline at end of file
+ }
Index: Modules/Tie-StringArray/t/splice.t
===================================================================
--- Modules/Tie-StringArray/t/splice.t (revision 236)
+++ Modules/Tie-StringArray/t/splice.t (working copy)
@@ -37,7 +37,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# splice ARRAY, OFFSET - does it work with only an offset

-{ # Postive OFFSET, list context
+{ # Positive OFFSET, list context
foreach my $offset ( 0 .. $#items )
{
my @array = @items;
@@ -56,7 +56,7 @@
}
}

-{ # Postive OFFSET, scalar context
+{ # Positive OFFSET, scalar context
foreach my $offset ( 0 .. $#items )
{
my @array = @items;
@@ -118,7 +118,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# splice ARRAY, OFFSET - does it work with only an offset

-{ # Postive OFFSET
+{ # Positive OFFSET
foreach my $offset ( 0 .. $#items )
{
my @array = @items;
@@ -161,7 +161,7 @@
# splice ARRAY, OFFSET, LENGTH - does it work with an offset and length


-{ # Positive OFFSET, Postive Length, list context
+{ # Positive OFFSET, Positive Length, list context
my @items = ( 1 .. 5 );

foreach my $offset ( 0 .. $#items )
@@ -190,7 +190,7 @@
}
}

-{ # Negative OFFSET, Postive Length
+{ # Negative OFFSET, Positive Length
my @items = ( 1 .. 5 );

foreach my $offset ( reverse - (scalar @items) .. -1 )
Index: Modules/Tie-Array-DNA/t/splice.t
===================================================================
--- Modules/Tie-Array-DNA/t/splice.t (revision 236)
+++ Modules/Tie-Array-DNA/t/splice.t (working copy)
@@ -37,7 +37,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# splice ARRAY, OFFSET - does it work with only an offset

-{ # Postive OFFSET, list context
+{ # Positive OFFSET, list context
foreach my $offset ( 0 .. $#items )
{
my @array = @items;
@@ -56,7 +56,7 @@
}
}

-{ # Postive OFFSET, scalar context
+{ # Positive OFFSET, scalar context
foreach my $offset ( 0 .. $#items )
{
my @array = @items;
@@ -118,7 +118,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# splice ARRAY, OFFSET - does it work with only an offset

-{ # Postive OFFSET
+{ # Positive OFFSET
foreach my $offset ( 0 .. $#items )
{
my @array = @items;
@@ -161,7 +161,7 @@
# splice ARRAY, OFFSET, LENGTH - does it work with an offset and length


-{ # Positive OFFSET, Postive Length, list context
+{ # Positive OFFSET, Positive Length, list context
my @items = ( 1 .. 5 );

foreach my $offset ( 0 .. $#items )
@@ -190,7 +190,7 @@
}
}

-{ # Negative OFFSET, Postive Length
+{ # Negative OFFSET, Positive Length
my @items = ( 1 .. 5 );

foreach my $offset ( reverse - (scalar @items) .. -1 )
Index: bin/pod2html
===================================================================
--- bin/pod2html (revision 236)
+++ bin/pod2html (working copy)
@@ -13,7 +13,7 @@

This script turns pseudopod files into HTML files. It takes the name
of the pseudopod file, removes the extension, and adds the .html extension
-to creat the new file.
+to create the new file.

=head1 SEE ALSO

Index: bin/pod2toc
===================================================================
--- bin/pod2toc (revision 236)
+++ bin/pod2toc (working copy)
@@ -25,7 +25,7 @@
=head1 DESCRIPTION

This script extracts the chapter, section, and other headings and prints
-a text report. It does this for all of the files I sepcify on the
+a text report. It does this for all of the files I specify on the
command line.

=head1 SEE ALSO
Index: Chapters/01.introduction.pod
===================================================================
--- Chapters/01.introduction.pod (revision 236)
+++ Chapters/01.introduction.pod (working copy)
@@ -26,7 +26,7 @@
that's where the "journey" part of the name came from) to other masters,
where they would learn new techniques and skills. Each master knew things
the others didn't, perhaps deliberately guarding secret methods, or knew
-it in a different way. Part of the journeymen's education was learning
+it in a different way. Part of the journeyman's education was learning
from more than one master.

Interactions with other masters and journeymen continue the master's
Index: Chapters/15.working_with_pod.pod
===================================================================
--- Chapters/15.working_with_pod.pod (revision 236)
+++ Chapters/15.working_with_pod.pod (working copy)
@@ -415,7 +415,7 @@
it's a true value it outputs the text, and if it's false, it doesn't.
This is what I can use to turn off output for all of the text that
doesn't belong to a heading. Additionally, I'll use C<$flag> to
-determine the indention level of my table of contents by putting the
+determine the indentation level of my table of contents by putting the
C<=head> level in it.

So, in order of execution: when I run into C<=head1>, M<Pod::Simple>
@@ -469,7 +469,7 @@

Once I've written my pod, I can check it to ensure that I've done
everything correctly. When other people read my documentation, they
-shouldn't get any warnings about formatiing, and a pod error shouldn't
+shouldn't get any warnings about formatting, and a pod error shouldn't
keep them from reading it because the parser gets confused. What good
is the documentation if the user can't even read it?

@@ -478,7 +478,7 @@
M<Pod::Checker> is another sort of pod translator, although instead of
spitting out the pod text in another format, it watches the pod and
text go by. When it finds something suspicious, it emits warnings.
-Perl already comes with C<podchecker>, a ready-to-use program similiar to
+Perl already comes with C<podchecker>, a ready-to-use program similar to
C<perl -c>, but for pod. The program is really just a program version of
M<Pod::Checker>, which is just another subclass of M<Pod::Parser>.

Index: Chapters/07.cleaning_up_code.pod
===================================================================
--- Chapters/07.cleaning_up_code.pod (revision 236)
+++ Chapters/07.cleaning_up_code.pod (working copy)
@@ -54,7 +54,7 @@
=head1 C<perltidy>

The C<perltidy> program reformats Perl programs to make them easier to
-read. Given a mess of code with odd indention styles (or no indention
+read. Given a mess of code with odd indentation styles (or no indentation
at all), little or no whitespace between tokens, and all other manner
of obfuscation, C<perltidy> creates something readable.

@@ -114,7 +114,7 @@

$ perltidy -gnu yucky

-Now the braces and indention are a bit different but it's still more
+Now the braces and indentation are a bit different but it's still more
readable than the original:

#!/usr/bin/perl
@@ -208,7 +208,7 @@

print $source;

-What I get out looks like what I imagine might be some extra-terrestial
+What I get out looks like what I imagine might be some extra-terrestrial
language:

$ perl japh-encoder.pl japh-p*
@@ -595,7 +595,7 @@
eval "require $module";

Normally, M<Perl::Critic> complains about that because it doesn't know
-that this paricular use is the only way to do this. Ricardo Signes
+that this particular use is the only way to do this. Ricardo Signes
created M<Perl::Critic::Lax> for just these situations. It adds a
bunch of policies that complain about a construct unless its a use,
such as my C<eval>-C<require>, that is a good idea. His policy
Index: Chapters/17.tied_variables.pod
===================================================================
--- Chapters/17.tied_variables.pod (revision 236)
+++ Chapters/17.tied_variables.pod (working copy)
@@ -181,7 +181,7 @@
behavior, I have to create two methods: C<STORE>, which Perl calls when I
assign a value, and C<FETCH>, which Perl calls when I access the value.
Along with those, I provide C<TIESCALAR>, which Perl calls when I use
-C<tie>, and possibly the C<DESTORY> or C<UNTIE> methods.
+C<tie>, and possibly the C<DESTROY> or C<UNTIE> methods.

The C<TIESCALAR> method works like any other constructor. It gets the
class name as its first argument, then a list of the remaining arguments.
@@ -727,7 +727,7 @@
}

To make this work I'll treat each position in my string as an array
-element. To store a value, In C<STORE> the argments are the index for
+element. To store a value, In C<STORE> the arguments are the index for
the value and value itself. I need to convert it to a character and
put that character in the right position in the string. If I try to
store something other than a whole number between 1 and 255, I get an
Index: Chapters/00.foreword.pod
===================================================================
--- Chapters/00.foreword.pod (revision 236)
+++ Chapters/00.foreword.pod (working copy)
@@ -2,7 +2,7 @@

=pod

-=head0 Foreward
+=head0 Foreword

XXX: Randal Schwartz will write the foreword

Index: Chapters/04.debugger.pod
===================================================================
--- Chapters/04.debugger.pod (revision 236)
+++ Chapters/04.debugger.pod (working copy)
@@ -618,7 +618,7 @@

In that output, notice the space after the last C<5>. Since C<wrap>
adding an element to C<@_>, even though it's C<undef> I get a space
-between it and the preceeding C<5> when I interpolate the array in
+between it and the preceding C<5> when I interpolate the array in
the double-quoted string.

M<Hook::LexWrap> has the magic to handle all the calling contexts too.
Index: Chapters/16.bit_vectors.pod
===================================================================
--- Chapters/16.bit_vectors.pod (revision 236)
+++ Chapters/16.bit_vectors.pod (working copy)
@@ -390,7 +390,7 @@

use Fcntl qw(:flock);

- open my($fh), '<+', $file or die "Connot open: $!";
+ open my($fh), '<+', $file or die "Cannot open: $!";
flock( $fh, LOCK_EX | LOCK_NB ) or die "Cannot lock: $!";

...;
Index: Chapters/06.benchmarking.pod
===================================================================
--- Chapters/06.benchmarking.pod (revision 236)
+++ Chapters/06.benchmarking.pod (working copy)
@@ -222,7 +222,7 @@

The output looks like the C<times> output I showed previously, but
this time it comes completely from within my Perl program and just for
-the parts of the program inside of the calls to C<Benchmark->new>.
+the parts of the program inside of the calls to C<< Benchmark->new >>.
Instead of timing the entire program, I can focus on the part I want
to examine.

@@ -950,7 +950,7 @@
After C<perlbench-run> reports the details of the interpreter, it runs
a series of Perl programs with each of the interpreters. It measures
the time to execute, much like M<Benchmark>'s C<timethese>. Once it
-tries the program with all of the intrepreters, it normalizes the
+tries the program with all of the interpreters, it normalizes the
results so that the first interpreter (that's the one labeled with
"A") is 100. Lower numbers in the other column mean that interpreter
is slower for that test. Higher numbers (they can be above 100) mean
Index: Chapters/05.profiling.pod
===================================================================
--- Chapters/05.profiling.pod (revision 236)
+++ Chapters/05.profiling.pod (working copy)
@@ -651,7 +651,7 @@
has several options to select the data to display, sort it in the way that
I want (even on multiple keys), and many other things.

- $ dbiprof --number all --sort longes
+ $ dbiprof --number all --sort longest

=head2 Switching Databases

Index: Chapters/12.error_handling.pod
===================================================================
--- Chapters/12.error_handling.pod (revision 236)
+++ Chapters/12.error_handling.pod (working copy)
@@ -492,7 +492,7 @@
The C<error> method actually lives in M<Template::Base> and it does
double duty as a method to set and later access the error message.
This function lives in the base class because it services all of the
-modules in the C<Template> family. It's actually quick slick in its
+modules in the C<Template> family. It's actually quite slick in its
simplicity and utility.

# From Template/Base.pm
@@ -514,10 +514,10 @@
}

After getting the first argument, it sets up C<$errvar>. If C<$self>
-is a reference (I<i.e.> called as C<$tt->error>) it must be an
-instance it looks in C<$self->{ _ERROR >. If C<$self> isn't a
+is a reference (I<i.e.> called as C<< $tt->error >>) it must be an
+instance it looks in C<< $self->{ _ERROR } >>. If C<$self> isn't a
reference, it must be a class name (I<i.e.> called as
-C<Template->error>), so it looks in the package variable to get a
+C<< Template->error >>), so it looks in the package variable to get a
reference to the error object. Notice the Andy has to turn off
symbolic reference checking there so he can construct the full package
specification for whichever class name is in C<$self>, which can be
@@ -581,12 +581,12 @@

=head2 Multiple Levels of C<die>

-If I use C<die> as an exception mechanism, I can propogate its message
+If I use C<die> as an exception mechanism, I can propagate its message
through several layers of C<eval>. If I don't give C<die> a message it
uses the current value of C<$@>.

#!/usr/bin/perl
- # chanined-die.pl
+ # chained-die.pl

eval{
eval {
@@ -609,8 +609,8 @@
print "I got $@"; # finally
}

-When I get the error message I see the chain of propogations. The
-orginal message C<Permission denied> comes from the first C<die> and
+When I get the error message I see the chain of propagations. The
+original message C<Permission denied> comes from the first C<die> and
each succeeding C<die> tacks on a C<...propagated> message until I
finally get to something that handles the error.

@@ -624,7 +624,7 @@
without an argument:

#!/usr/bin/perl
- # chanined-die-more-info.pl
+ # chained-die-more-info.pl

eval{
eval {
@@ -639,7 +639,7 @@
my $user = getpwuid( $< );
my $mode = ( stat $file )[2];
$@ .= sprintf "\t%s mode is %o\n", $file, $mode;
- $@ .= sprintf( "\t%s is not writeable by %s\n", $file, $user )
+ $@ .= sprintf( "\t%s is not writable by %s\n", $file, $user )
unless -w $file;
die; # first catch
}
@@ -659,7 +659,7 @@

I got Permission denied at chained-die-more-info.pl line 10.
/etc/passwd mode is 100644
- /etc/passwd is not writeable by brian
+ /etc/passwd is not writable by brian
...propagated at chained-die-more-info.pl line 19.
...propagated at chained-die-more-info.pl line 24.

@@ -740,7 +740,7 @@

=head2 Propagating Objects with C<die>

-Since C<die> without an argument propogates whatever is in C<$@> it
+Since C<die> without an argument propagates whatever is in C<$@> it
will do that if C<$@> holds a reference. This next script is similar
to my previous chained-die example except that I'm storing the
information in an anonymous hash. This makes the error message easier
@@ -752,7 +752,7 @@
need:

#!/usr/bin/perl
- # chanined-die-reference.pl
+ # chained-die-reference.pl

eval{
eval {
@@ -795,13 +795,13 @@
In M<Local::Error> I skip the usual good module programming practices
to illustrate the process. In C<new> I simply bless the first argument
into the package and return it. In my first C<die> I use as the
-argment my M<Local::Error> object. After that each C<die> without an
+argument my M<Local::Error> object. After that each C<die> without an
argument uses the value of C<$@>. Since C<$@> is an object Perl calls
its C<PROPAGATE> method, in which I add a new element to
-C<$self->{chain}> to show the file and line that passed on the error.
+C<< $self->{chain} >> to show the file and line that passed on the error.

#!/usr/bin/perl
- # chanined-die-propagate.pl
+ # chained-die-propagate.pl
use strict;
use warnings;

Index: Chapters/08.symbol_tables.pod
===================================================================
--- Chapters/08.symbol_tables.pod (revision 236)
+++ Chapters/08.symbol_tables.pod (working copy)
@@ -104,7 +104,7 @@
obviously the one I set. However, when it calls C<show_me>, the code
jumps out of the subroutine. Outside of the subroutine, the lexical
variable has no effect. In the output, the line I tagged with C<From
-lexcial()> shows C<I'm the global version>.
+lexical()> shows C<I'm the global version>.

sub lexical
{
@@ -233,7 +233,7 @@
it, I have to remember that those are the variable names without the
sigils. When I see the identifier C<_>, I have to remember that it has
references to the variables C<$_>, C<@_>, and so on. Here are some special
-variable names that Perl programmers will recongize once they put a
+variable names that Perl programmers will recognize once they put a
sigil in front of them:

/
Index: Chapters/11.configuration.pod
===================================================================
--- Chapters/11.configuration.pod (revision 236)
+++ Chapters/11.configuration.pod (working copy)
@@ -878,7 +878,7 @@
book_author=brian d foy

With a small change I can let my program handle the command line
-arguments too. When I call C<$config->args()> without an argument
+arguments too. When I call C<< $config->args() >> without an argument
M<AppConfig> processes C<@ARGV> using M<Getopt::Long>:

#!/usr/bin/perl
@@ -904,7 +904,7 @@

Now when I run my program and supply another value for C<network_email>
on the command line, its value overrides the one from the file because
-I use C<$config->args> after C<$config->file>.
+I use C<< $config->args >> after C<< $config->file >>.

$ perl appconfig-args.pl
Kindly send complaints to brian d foy (brian.d.foy at gmail.com)
Index: Chapters/10.subclassing.pod
===================================================================
--- Chapters/10.subclassing.pod (revision 236)
+++ Chapters/10.subclassing.pod (working copy)
@@ -685,7 +685,7 @@

The documentation of C<diff> and C<patch> discuss their use. The C<patch>
man page is particularly instructive since it contains a section near the
-end that talkas about the pragmatic considerations of using the tools and
+end that talks about the pragmatic considerations of using the tools and
dealing with other programmers.


Index: Chapters/A2.brians_guide.pod
===================================================================
--- Chapters/A2.brians_guide.pod (revision 236)
+++ Chapters/A2.brians_guide.pod (working copy)
@@ -7,7 +7,7 @@
C<http://articles.mongueurs.net/traductions/guide_brian.html> and
chinese:
U<http://wiki.perlchina.org/main/show/brian's%20Guide%20to%20Solving%20Any%20Perl%20Problem>.>.
-Some of the stuff I did unconsiously, and
+Some of the stuff I did unconsciously, and
those are the hardest things to pass onto a new programmer. Now that I
have this guide, other people can develop their own problem-solving
skills. It might not solve all of your Perl problems, but it's a good
@@ -183,7 +183,7 @@

=item Have you made a small test case?

-If you're trying something new, or think a particular peice of code is
+If you're trying something new, or think a particular piece of code is
acting funny, write the shortest possible program to do just that
piece. This removes most of the other factors from consideration. If
the small test program does what it thinks it does, the problem


More information about the Mastering-perl mailing list