in reply to Please critique this script -- Read emails and write URLs into bookmarks
Modern Perl assumes you're already decent at programming, so it elides some basic stuff in favor of explaining how Perl works from philosophy to programming in the large. Learning Perl assumes you've never programmed before, so it spends more time on the basics, covers less of the language, and doesn't explore the philosophy of Perl in as much detail.
-- chromatic (author of Modern Perl) comments on the philosophy behind his book
Given this is your first Perl script, you have demonstrated that you are an accomplished programmer, who is new to Perl. Accordingly, I feel Modern Perl is more appropriate for you than Learning Perl. Modern Perl is free and very quick to read. If you have more time, and want to get inside the head of the language designer, Programming Perl is also good.
As for good "second" books on Perl, I suggest:
In particular, Perl Best Practices, Chapter 4, "Values and Expressions" in the "Don't mix high- and low-precedence booleans" item, discusses a stylistic point already raised in this thread.
For flow of control, prefer the low precedence and and or operators. A common example of preferring or to || is:
Reserve && and || for logical expressions, not flow of control, for example:open(my $fh, '<', $file) or die "error opening '$file': $!";
if ($x > 5 && $y < 10) ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Please critique this script -- Read emails and write URLs into bookmarks
by Anonymous Monk on Oct 12, 2016 at 08:41 UTC | |
by eyepopslikeamosquito (Archbishop) on Oct 13, 2016 at 09:09 UTC | |
by afoken (Chancellor) on Oct 13, 2016 at 07:13 UTC |