Skip to content

Commit

Permalink
update re tchrist's comments on perl 4
Browse files Browse the repository at this point in the history
The Perl 4 code I wrote wasn't perl 4 code.
Tom Christian rightly pointed out that perl 4 doesn't even have references.

Make it clear I started off writing Perl 5 code that was inspired by Perl 4's lack of Objects, not I started off writing Perl 4 code.
  • Loading branch information
2shortplanks committed Dec 25, 2024
1 parent 4e08e7b commit 88b7491
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions 2024/articles/2024-12-24.pod
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ years we've seen some of these experiments being turned into best practices that
are built into the language itself.

When I first learned Perl in 1998, I started with the "pink" version of Larry
Wall's "Programming Perl" book. This talked about Perl 4, Perl before we even
had objects. If I wanted to represent a triangle and try to calculate its area
I might have written code something like this:
Wall's "Programming Perl" book, which only covered Perl 4 and hence didn't cover
the topic of objects I<at all>. This resulted in some of the first Perl 5 code
I wrote looking like this:

=begin perl

Expand All @@ -84,9 +84,10 @@ print "triangle_area($shape), "\n";

My understanding of Perl changed pretty quickly when I started reading the
man pages for the version of Perl I had installed and got my hands on the
"blue" second edition of "Programming Perl" which talked about Perl 5.
"blue" second edition of "Programming Perl".

Perl 5 had objects and the kind of Perl I would write would be more like this:
Learning Perl 5's object model meant the kind of Perl I would write would be
more like this:

=begin perl

Expand Down

0 comments on commit 88b7491

Please sign in to comment.