Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Modifying loop structure and placement

by merlyn (Sage)
on Dec 24, 2009 at 02:05 UTC ( #814181=note: print w/replies, xml ) Need Help??

in reply to Modifying loop structure and placement

Are you serious? This is one of the exercises in JLFord's book? This is exactly the same exercise rootbeer created for our Learning Perl book.

Of course, it's not that unobvious of a question, but this now seems suspicious. Do you have a copy of Learning Perl to compare some of the other exercises for me? I'm curious now.

-- Randal L. Schwartz, Perl hacker

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

  • Comment on Re: Modifying loop structure and placement

Replies are listed 'Best First'.
Re^2: Modifying loop structure and placement
by irvson (Sexton) on Dec 30, 2009 at 22:13 UTC
    Yes, the Ford script does the same thing, but it's much more involved -- about 175 lines of code. Longer doesn't mean better, of course. I found your script and created the PL file. Much simpler, does the same thing, but uses a regular expression -- which Ford hasn't covered at that point in his book. There sure is a lot to learn here, and comparing the two scripts for "economy" and "verbosity" is just one of those things.
Re^2: Modifying loop structure and placement
by irvson (Sexton) on Dec 30, 2009 at 22:24 UTC
    (Oops. Forgot the second part of your question.) I have both books. I'll look for other similarities. Altho your code in this example is so completely different from Ford's that I would not have noticed the similarity right away. I'm just getting started with your book. I'll keep my eyes peeled. (You would probably satisfy your curiosity more quickly by buying a copy of his book -- or getting it from a library. He constructs each chapter so that the script he uses at the end of the chapter sums up what he presented in that chapter.)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://814181]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2018-06-19 13:42 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (114 votes). Check out past polls.