develooper Front page | perl.perl5.porters | Postings from February 2013

Re: Don't patch perlopentut: rewrite it completely

Thread Previous | Thread Next
David Golden
February 17, 2013 11:25
Re: Don't patch perlopentut: rewrite it completely
Message ID:
On Sat, Feb 16, 2013 at 8:30 PM, Tom Christiansen <> wrote:
> SUMMARY: Let's rename perlopentut and write a new one from scratch.


I think a  newbie tutorial rewrite is a good idea.  Thank you for
stepping back, realizing that, and providing a draft.

I have smallish quibbles, some factual (perlfaq5 vs perlfaq4), and
some stylistic and a bunch of thoughts which are less well resolved in
my head.

I do appreciate the switch to showing 3-arg open.  I strongly favor
showing "or die..." instead of "|| die..." because the lower
precedence operator is safer should parentheses be omitted.

*Note*: I am *not* advocating removal of parentheses nor saying that
"||" is invalid or wrong.  I'm saying that the low-precedence "or" for
trailing statement clauses is more robust in the face of programmer
error and is thus a better style for newbies to copy from.

I really appreciate the strong statement about specifying encodings
explicitly.  It may not be common in practice, but it is *exactly* one
of those things that people were never taught and thus rarely do.

I think pipes and sysopen can be left to a "more than you wanted to
know" document.

I would mention "flock" in perlfunc as well as pointing to perlfaq5.

I wonder if it is worth discussing IO::File->new and the equivalence
to "open".  (At the end -- in a section about IO::File specifically,
most likely).

Likewise, I wonder if it is worth discussing autoflush or how files
don't get flushed to close.  (I leave the question of error checking
close to the other thread. :-)

I wonder if it is worth briefly mentioning that binmode is not really
the same as specifying an encoding on open, or if this just opens the
Pandora's box of evil that is PerlIO layers.

I think it is worth mentioning (briefly) that "write" is not the
opposite of "read".


David Golden <>
Take back your inbox! →
Twitter/IRC: @xdg

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About