Perl Tutorial Book (was Re: SED GURUS: Some Newline Questions) 
Author Message
 Perl Tutorial Book (was Re: SED GURUS: Some Newline Questions)

[watch your followups, please]

   Learning perl is sooo easy to put off.  The books for both awk and c
   are only a couple of hundred pages.  The Understanding Perl book is
   over 400 pages!  The size of the awk and c books draw you to them,
   while the perl book says "Maybe tomorrow..."

"Programming Perl" is three books in one: about 100 pages of tutorial,
about 150 pages of reference information (essentially the manpage
prettied up), and about 150 pages of huge examples and advanced
information (and 3 pages of jokes :-).

What *you* are probably looking for is a simple tutorial book on Perl.
You and hundreds of other people.  We know.  Sooooooo.....

Look for a *new* Nutshell Handbook on Perl out in First Quarter '93
consisting of dozen lessons, with text (lots of examples), exercises,
and explained answers.  This book should be suitable for classroom use
(provided I get the right reviewers :-) equivalent to a 40-hour
half-lecture/half-lab seminar.  Figure on about 200 pages or so.  The
title is not final; we're waffling between "Learning Perl" and
"Introduction to Perl".

Authors? Me, and almost certainly two other *big* Perl names.  You can
guess which ones.  Publisher? O'Reilly and Associates, just like the
Camel Book.  Cover Animal? Who knows! (No suggestions please... a
thousand pieces of email with Oyster or Baby Camel won't make an bit
of difference.)

print "Just another Perl [book] hacker,"
--
Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095

cute quote: "Welcome to Portland, Oregon -- home of the California Raisins!"



Mon, 06 Mar 1995 23:12:22 GMT  
 Perl Tutorial Book (was Re: SED GURUS: Some Newline Questions)

Quote:

>What *you* are probably looking for is a simple tutorial book on Perl.
>You and hundreds of other people.  We know.  Sooooooo.....

   ...

Quote:
>Look for a *new* Nutshell Handbook on Perl out in First Quarter '93
>consisting of dozen lessons, with text (lots of examples), exercises,
>and explained answers.  This book should be suitable for classroom use
>(provided I get the right reviewers :-) equivalent to a 40-hour

   ...

   Well, if it is coming out in 1Q93 it is probably too late to
   have any influence on the style :-(  But as one who will
   probably try and use it for teaching purposes (since it strains
   credibility that it could be any *worse* than the Camel book
   for classroom use), let me just say that IMHO the original K&R
   book should be a model for anyone writing a book for classroom
   use.  (By the original K&R book, of course, I mean "The C Programming
   Language".  Terse, a gradual build-up of techniques, teaches good
   practices as well as the language itself, and excellent examples).

   Actually, I hate like hell to say anything which sounds critical
   regarding the Camel book.  For one thing, Randal and Larry are
   such *nice* people, over and above Larry occupying a place in my
   personal Hall of Fame. And for another thing, it is infinitely
   better than what was there before.  :-)

   John
--
John W. Nall              | Supercomputer Computations Research Institute

 "Candied apples, brandied peaches, roasted pork and last year's wine..."
                                 - a song Tom T. Hall never wrote, but should have...



Tue, 07 Mar 1995 02:32:34 GMT  
 Perl Tutorial Book (was Re: SED GURUS: Some Newline Questions)



|>    Learning perl is sooo easy to put off.  The books for both awk and c
|>    are only a couple of hundred pages.  The Understanding Perl book is
|>    over 400 pages!  The size of the awk and c books draw you to them,
|>    while the perl book says "Maybe tomorrow..."
[...]
|> What *you* are probably looking for is a simple tutorial book on Perl.
|> [...]  We know.  Sooooooo.....
|>
|> Look for a *new* Nutshell Handbook on Perl out in First Quarter '93

Wow, a Perl book on my behalf!  Thanks, guys!  You're determined to make
a Perl user out of me, right?  Well, I'll settle for an acknowledgement
in the book. :0

I'm really looking forward to a more concise guide on Perl.  I've
noticed that O'Reilly books come in all sizes; the Intro to Unix book,
well, let's just say I've gotten pamphlets in front of Food Lion that
were bigger than it.  At the other end of the spectrum, the Motif Manual
weighs in at a hefty 1000 pages.

ObPerlQuestion:  What is the Perl equivalent of:

sed "s/string1/string2/
     s/string3/string4/"

Do you have to use the -e option each time, like:

perl -pe 's/string1/string2/' -e 's/string3/string4/'

(Yes, I _do_ know about s2p.  When I try to input the sed
 string, I get "unrecognized substitution command" and
 "malformed substitution".)

--Cousin It

"is the new world rising from the shambles of the old?"



Tue, 07 Mar 1995 11:16:41 GMT  
 Perl Tutorial Book (was Re: SED GURUS: Some Newline Questions)
I don't know much about sed, but I hope this helps anyway.



   ObPerlQuestion:  What is the Perl equivalent of:

   sed "s/string1/string2/
        s/string3/string4/"

   Do you have to use the -e option each time, like:

   perl -pe 's/string1/string2/' -e 's/string3/string4/'

Nope:

perl -pe 's/string1/string2/; s/string3/string4/'

   (Yes, I _do_ know about s2p.  When I try to input the sed
    string, I get "unrecognized substitution command" and
    "malformed substitution".)

Try this:

$ s2p
s/string1/string2/
s/string3/string4/
^D
[s2p translation printed on stdout]

Jon Vander Hill



Tue, 07 Mar 1995 23:35:48 GMT  
 Perl Tutorial Book (was Re: SED GURUS: Some Newline Questions)

Quote:

>ObPerlQuestion:  What is the Perl equivalent of:
>sed "s/string1/string2/
>     s/string3/string4/"
>Do you have to use the -e option each time, like:
>perl -pe 's/string1/string2/' -e 's/string3/string4/'

Only if you want to

perl -pe 's/string1/string2/; s/string3/string4/'

works just fine.

--
Perl's Maternal Uncle
Mark Biggar



Tue, 07 Mar 1995 23:56:38 GMT  
 Perl Tutorial Book (was Re: SED GURUS: Some Newline Questions)

fester> ObPerlQuestion: What is the Perl equivalent of:

fester> sed "s/string1/string2/ s/string3/string4/"

fester> Do you have to use the -e option each time, like:

fester> perl -pe 's/string1/string2/' -e 's/string3/string4/'

No. Just use:

        perl -pe 's/string1/string2/;s/string3/string4/;'

Anything that you could put inside of a while loop can be used with -e
(is this ALWAYS the case).

                        -AJS

$_='Just another pearl';s/ea/e/;s/$/ {*filter*}!\n/;print;
--
--------
Disclaimer: I am solely responsible for the content of this message.
The views expressed here may not be the views of I-Kinetics, Fidelity,
any of the Fidelity-owned corporations or my mother.



Wed, 08 Mar 1995 02:27:16 GMT  
 Perl Tutorial Book (was Re: SED GURUS: Some Newline Questions)
|>ObPerlQuestion:  What is the Perl equivalent of:
|>
|>sed "s/string1/string2/
|>     s/string3/string4/"
|>
|>Do you have to use the -e option each time, like:
|>
|>perl -pe 's/string1/string2/' -e 's/string3/string4/'
|>
|>(Yes, I _do_ know about s2p.  When I try to input the sed
|> string, I get "unrecognized substitution command" and
|> "malformed substitution".)

I'm not a Perl God so I'm a bit nervous in sticking my neck out
in the company of the True Gods :-), but I think your answer is
simply to make the two substitutes two statements....

perl -pe 's/string1/string2/; s/string3/string4/'

You can have endless fun with variations on this too....

perl -pe 's/string1/string2/g; s/string3/string4/g'
        # substitute everywhere in the input string, not just the
        # first occurence

perl -pe 's/string1/string2/ && s/string3/string4'
        # only perform the second substituion if the first substitution
        # happened

perl -pe 's/string1/string2/ || s/string3/string4'
        # only perform the second substitution  if the first
        # substitution failed

I've tested all of these, so they should work (apart from misprints).

Lezz "JAPH" Giles



Tue, 07 Mar 1995 21:49:50 GMT  
 Perl Tutorial Book (was Re: SED GURUS: Some Newline Questions)
: ObPerlQuestion:  What is the Perl equivalent of:
:
: sed "s/string1/string2/
:      s/string3/string4/"
:
: Do you have to use the -e option each time, like:
:
: perl -pe 's/string1/string2/' -e 's/string3/string4/'

You can do it that way, but you don't have to.  Alternatives include:

    perl -pe 's/string1/string2/;s/string3/string4/'
    perl -pe 's/string1/string2/
              s/string3/string4/'

(This presumes you're running sh, of course, on the second one.  Neither
that nor your original one will work in csh.)

: (Yes, I _do_ know about s2p.  When I try to input the sed
:  string, I get "unrecognized substitution command" and
:  "malformed substitution".)

That's because you're feeding a shell command to something that only
understands the sed language.  Sed doesn't understand the command "sed"
either.

: "is the new world rising from the shambles of the old?"

That's the basic idea.  We stand on the shoulders of giants and kick
their ears whenever we feel like it.

Larry



Wed, 08 Mar 1995 09:37:02 GMT  
 Perl Tutorial Book (was Re: SED GURUS: Some Newline Questions)

Quote:

>             .....  Publisher? O'Reilly and Associates, just like the
> Camel Book.  Cover Animal? Who knows! (No suggestions please... a
> thousand pieces of email with Oyster or Baby Camel won't make an bit
> of difference.)

There is only one _possible_ animal suitable for the cover of this
book.  (The camel is an ungainly beast, but that ain't it!)  For a
language that looks as "cobbled together" as Perl, the only suitable
animal has to be the ......

       Platypus !!

[I suggested this to Randal, who has already made a, shall we say,
 _appropriate_ reply. :-)]

--
John G Dobnick                          ATTnet: (414) 229-5727

University of Wisconsin - Milwaukee     UUCP: uunet!uwm!jgd

"Knowing how things work is the basis for appreciation,
and is thus a source of civilized delight."  -- William Safire



Thu, 09 Mar 1995 08:26:07 GMT  
 Perl Tutorial Book (was Re: SED GURUS: Some Newline Questions)

: "Programming Perl" is three books in one: about 100 pages of tutorial,
: about 150 pages of reference information (essentially the manpage
: prettied up), and about 150 pages of huge examples and advanced
: information (and 3 pages of jokes :-).
:
: What *you* are probably looking for is a simple tutorial book on Perl.
: You and hundreds of other people.  We know.  Sooooooo.....

I started learning perl before there was a perl book so my opinion is
probably tainted, but...  I've always found the perl man page doc (all
66 pages of it) to be a better doc, for me, than the perl book.  It
seems more to the point.  The perl book is just too much stuff.  My
approach to learning perl was to sit down and skim, I said skim, the
whole perl man doc.  From there on out, every time I hit a problem, I
knew where to go for the answer (yeah, you can fall back on the net and
I did, a time or two).

Anyway, my plea is for a version of the perl man doc printed on small
loose leaf pages, like the 4.2 and 4.3 BSD doc reprints that Usenix
did.  So it can sit open on my desk and not take over the whole thing.
While I'm at it, I'd love it if O'Reilly printed all their books like
the BSD / Usenix docs.
---



Fri, 10 Mar 1995 13:35:42 GMT  
 Perl Tutorial Book (was Re: SED GURUS: Some Newline Questions)

|>    Well, if it is coming out in 1Q93 it is probably too late to
|>    have any influence on the style :-(  But as one who will
|>    probably try and use it for teaching purposes (since it strains
|>    credibility that it could be any *worse* than the Camel book
|>    for classroom use), let me just say that IMHO the original K&R
|>    book should be a model for anyone writing a book for classroom
|>    use.  (By the original K&R book, of course, I mean "The C Programming
|>    Language".  Terse, a gradual build-up of techniques, teaches good
|>    practices as well as the language itself, and excellent examples).

I have to agree with this (even though you are a Seminole :)  The C
Programming Language and the Awk Programming Language are the two best
books that I've come across for learning languages.  The worst?  Well,
let's just say I had to learn Cobol, but that's mainly a language
deficiency :0  

One problem I've had with the Perl book is that its bulky size makes it
difficult to use while at the terminal, but maybe the new "lay-flat"
binding addresses this.  (Too bad we can't "upgrade" though... :(

ObPerlQuestion: none! (but thanks for the last answer)

--Cousin It

``Ooh, your custard pie, ain't seen the like
  When you cut it, mama, save me a slice
  Your custard pie, I declare, ain't seen the like
  I like your custard pie.''



Fri, 10 Mar 1995 22:46:10 GMT  
 
 [ 27 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Sed in Perl Script Versus Sed in Unix

2. free book on sh/sed/awk

3. When did you last use AWK (was Re: free book on sh/sed/awk)

4. free book on sh/sed/awk

5. Books Tutorials for perl

6. Perl Tutorials or E-Books

7. Looking for good tutorial/book on Perl programming.

8. Looking for Perl OOP Book / Tutorial

9. I am a biginer i need to find a good tutorial in cfg

10. looking for online perl/tk tutorial and book titles

11. NEWBIE: Perl/Tk tutorials/books

12. Need good Perl tk tutorial or book

 

 
Powered by phpBB® Forum Software