[7949] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1574 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 3 10:08:54 1998

Date: Sat, 3 Jan 98 07:00:28 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 3 Jan 1998     Volume: 8 Number: 1574

Today's topics:
     Re: Camel book v. Win32 <joseph@5sigma.com>
     Re: Camel Critiques: PERL: THE PROGRAMMER'S COMPANION <pvhp@forte.com>
     Re: Effective Perl Contest... word game. <shadowweb@worsdall.demon.co.uk>
     Re: Fast Suggestions for this string manipulation probl <shadowweb@worsdall.demon.co.uk>
     Help wanted for new perl programmer <gregc@ekn.net>
     Re: Help wanted for new perl programmer (Jonathan Stowe)
     Re: Help wanted for new perl programmer (Thijs Kinkhorst)
     Re: How to check files exists and if it does then? <shadowweb@worsdall.demon.co.uk>
     How to set semaphore value in Perl? <xucheng@iscs.nus.edu.sg>
     Re: I need money [Re: I need a script] <engleae@fred.net>
     Re: I need money [Re: I need a script] (brian d foy)
     Re: perl is c worsened (was: Re: word wrap routine) (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     Re: Perl Trick? <webmaster@fccj.cc.fl.us>
     Re: PERLIPC - FIFO: parent, child, stalled! <merlyn@stonehenge.com>
     Re: recomended Perl books ? (Martin Vorlaender)
     Re: recomended Perl books ? <merlyn@stonehenge.com>
     Re: recomended Perl books ? <joseph@5sigma.com>
     Return value of system djboyd@sam.on-net.net
     Re: Return value of system <merlyn@stonehenge.com>
     time module? <oberon@nospam.erols.com>
     Unexpected problem with the query string (Bud Bundy)
     Re: word wrap routine (brian d foy)
     Re: WWW database <pvhp@forte.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 02 Jan 1998 22:31:27 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Camel book v. Win32
Message-Id: <34ADCCDF.2A6A93F@5sigma.com>

I would say it's moreso.  It's hard to avoid, and besides, the
UNIX programming interface in the guise of POSIX is coming soon
to just about every operating system near you.

There are, however, very few intrinsic UNIX-ities in Perl nowadays.

	-joseph

Mark Folse wrote:
> 
> Not to change the subject (well, yes to change the subject slightly) is
> the Camel Book presumably as UNIX-centric as the Llama book? Is it a good
> investment for someone stranded behind the Windows in DOSneyland?


------------------------------

Date: Tue, 30 Dec 1997 21:50:57 -0800
From: Peter Prymmer <pvhp@forte.com>
Subject: Re: Camel Critiques: PERL: THE PROGRAMMER'S COMPANION
Message-Id: <34A9DD41.687@forte.com>

Tom Christiansen wrote:
> 
>     Title:      Perl: The Programmer's Companion
>     Author:     Nigel Chapman.
>     ISBN:       0-471-97563-X.
>     Publisher:  John Wiley & Sons
>     Size:       268pp
>     Price:      $29.95
>     Rating:     5 out of 5
> 
> I give this work five camels.  Yup, that's what I said; I may be waxing
> overly ecstatic and perhaps shall renege later.  I've only spot checked
> it so far, but with delight.  But it sure looks terrific.  Everything I
> looked at was right on the money technically, even scoping, which no
> one ever ever gets right.
> 
> The book was written by a fellow from in the UK.  It's a tiny, no frills,
> no crap book designed for programmers by one of their own, with a touch of
> whimsey thrown in.  Malcolm Beattie, release manager for 5.005 and author
> of the Perl code-generator, was the technical reviewer.  The English is
> well-formed, perhaps even literate.  It doesn't talk down to its audience,
> nor does it confuse them with distracting layout gimmicks.
> 
> This book is a pleasure to read.
> 
> The epilogue is really worth raving about.  I can't repro it here.
> It's a coffee shop dialogue on theory versus practice, and what we
> programmers have been doing wrong a long time.  I almost wonder whether
> Larry wrote it pseudonymously. :-)
> 

<snip>


> In short, I like this book.

I had seen this book on the shelf in a Berkeley Barnes & Noble before
reading your very favorable review.  When I skimmed over the epilogue
the first time I came away thinking that Mr. Chapman had done himself a
disservice by including a usenet language debate that came down somewhat
hard on Perl.

  Your comments induced me to go purchase the volume and I must say 
that it is indeed a fine book and rather entertaining.  I am
nevertheless inclined to think that Nigel has done himself and Perl a
disservice by saying things such as:

  "...Perl is unlikely ever to be the language of choice for digital
   video capture or 3D scene rendering."  (pg. 263)

Has Nigel taken a look at PDL or some of Stan Melax's OpenGL demo
scripts?  The OpenGL demo with the rotating view of the Starship
Enterprise flying around above a checkerboard is only 60 lines of perl! 
(Well to be honest, Nigel's comments are on the money since the real
work of the OpenGL demo is done in XS and C after all.  On page 3 he 
did mention that "image manipulation" is one application domain 
covered by perl modules).

  One other tiny technical problem I have with the text is the fixed
width font used for source code samples which suffers from the same
problem as Paul Hoffman's B<Perl 5 for Dummies> in that one cannot
distinguish between the backticks `` and the foreticks '' (Nigel's 
book was apparently written up in LaTeX).

  Such minor quibbles aside, Nigel Chapman's book *is* a pleasant read
and I like it too.  It is certainly amusing to see the IBM-doc style
syntax diagrams for perl.

Peter Prymmer


------------------------------

Date: Sat, 3 Jan 1998 03:34:31 +0000
From: Mark Worsdall <shadowweb@worsdall.demon.co.uk>
Subject: Re: Effective Perl Contest... word game.
Message-Id: <19twvbAHHbr0Ewkw@worsdall.demon.co.uk>

In article <comdog-ya02408000R0101980459330001@news.panix.com>, brian d
foy <comdog@computerdog.com> writes
>In article <qz$9712302256@qz.little-neck.ny.us>, Eli the Bearded <#@qz.to> 
>wrote:
>
>>Martin D Schweitzer <martin@matilda.vut.edu.au> wrote:
>>> Here is a problem:
>>> 
>>> I have written a word game.  The user must find all words using
>>> the letters given in a square, e.g:
>>> 
>>> H A N
>>> D I W
>>> O R K
>>
>>(1) All words using those letters? Eg "KIND" is allowed.
>>(2) All words that you can trace a line through without leaving the box or
>>    crossing lines? Eg "HAIR":
>>
>>        H A
>>          I
>>          R
>>
>>(3) All words that can be formed by dropping letters from "HANDIWORK"?
>>    Eg. "ARK".
>>
>>Each of these will have a different solution.
>
>is this basically scrabble?
>
[snip]
I would think they are trying to di a boggle (US) bog (UK) word game, so
KIND would not be allowed whereas HAIR would be. 

Ofcourse really to get your 98 (sorry Y2C) 1998 brain cells feastering
why not make a rule set for the player to chose 1 of 3 game types.
-- 
Mark Worsdall (Webmaster) - WEB site:- http://www.shadow.org.uk
Shadow:- webmaster@shadow.org.uk    
Home  :- shadowweb@worsdall.demon.co.uk
Any opinion given is my own personal belief...


------------------------------

Date: Sat, 3 Jan 1998 04:07:09 +0000
From: Mark Worsdall <shadowweb@worsdall.demon.co.uk>
Subject: Re: Fast Suggestions for this string manipulation problem
Message-Id: <Zdn7HhAtlbr0EwjT@worsdall.demon.co.uk>

In article <waaoh1zpixt.fsf@ese.UCSC.EDU>, "William R. Ward"
<hermit@cats.ucsc.edu> writes
>Rhodri James <rhodri@wildebst.demon.co.uk> writes:
>>   if (/\.demon\.co\.uk$/)
>>   {
>>      # Do demon summoning stuff
>>   }
>>   elsif (/\.co\./)
>>   {
>>      # National companies -- do something despite the management
>>   }
>>   elsif (/\.mil/)
>>   {
>>      # US Military -- do something, sir
>>   }
>
>These regular expressions are pretty inefficient.  They should be
>anchored.  I suggest /\.co\.??$/ and /\.mil$/ respectively, instead.
>
umm.

Well I am still working on my problem, so maybe another explanation
would help:-

I have the following domain names (each day there are different ones):-

dns1.rosetta.tased.edu.au
enterprise.ae.ic.ac.uk
stlpjk.gtri.gatech.edu
ecgmac.repoc.nwu.edu
safecity.lanl.gov
remote223.pppl.gov
longrie.nrl.navy.mil
mitre.org
askew.columbia-center.org
taos.nj.nec.com
quebectel.com
login20.pncl.co.uk
bluerobin.mke.co.jp
ts1-37.iprolink.co.nz
fridge1.volvo.se
ppp146.netactive.co.za
inter511.internet.com.mx

And I wish to end up with:-

tased.edu.au
ae.ic.ac.uk
gtri.gatech.edu
ecgmac.repoc.nwu.edu
lanl.gov
pppl.gov
nrl.navy.mil
mitre.org
columbia-center.org
nec.com
quebectel.com
pncl.co.uk
bluerobin.mke.co.jp
iprolink.co.nz
volvo.se
netactive.co.za
internet.com.mx

Only one domain name is passed to the program at a time OR a seperate
program is ran per domain name.

So my problem is deciding what rules to adopt for chopping begginings of
domain names:-

1) if ends in .com then chop all off BAR 1 left with worsdall.com
2) if ends with .com. then reduce to internet.com.mx or internet.com.au,
dependening on the original domain name.
3) if ends with .demon.co.uk and has only 1 word before the first . then
leave alone (there maybe other ISP operating like this).
4) if ends with .co. but not rule 3 then do a rule 2
5) if academic then for now reduce 1st word only (ubless someone knows
the rules for ac/edu sites?)
6) if .org. then rule 2
7) if .org then rule 1
8) if .mil then reduce to 2 dots
9) if .gov rule 8
10) if non rules above leave alone, do not know about fridge1.volvo.se 
reducing to volvo.se

At the moment I am simply doing this:-

sub sort_domain {

# If $surfername has been successfully translated into domain name
if ($surfername !~ /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/) {
        # If $surfername does not contain .demon.co.uk
        if ( rindex($surfername, '.demon.co.uk') == -1) {
        # Then we knock off the first word from a dot, 
        # put result into name
        $name = substr($surfername, index($surfername, '.')+1,
length($surfername)-index($surfername, '.'));
        # Ensure we have not knocked off to many words
        # i.e. ended up with com or net only
                if ( index($name, '.') != -1) { $surfername = $name; }
        }
}


but about to change to:-


#  if (/\.demon\.co\.uk$/)
#  {
     # Do demon summoning stuff
#  }
#  elsif (/\.co\./)
#  {
     # National companies -- do something despite the management
#  }
#  elsif (/\.mil/)
#  {
     # US Military -- do something, sir
#  }

#  I suggest /\.co\.??$/ and /\.mil$/ 


-- 
Mark Worsdall (Webmaster) - WEB site:- http://www.shadow.org.uk
Shadow:- webmaster@shadow.org.uk    
Home  :- shadowweb@worsdall.demon.co.uk
Any opinion given is my own personal belief...


------------------------------

Date: Sat, 03 Jan 1998 03:40:12 -0500
From: Greg Cobble /TechJD <gregc@ekn.net>
Subject: Help wanted for new perl programmer
Message-Id: <34ADF96C.30BBE556@ekn.net>

This is a multi-part message in MIME format.
--------------6D0596454D57486CB0CFFDEC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi I have some programming background (basic, fortran, cobol,(oldtimer
lol) and  VB )
perl and cgi are new to me 
I'm working on a chat script and want to make the the user able 
to change the background color , the script runs good with out this
option , I'm getting 

Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, [no address given] and inform
them of the time the error occurred, and anything
you might have done that may have caused the error.

There was also some additional information available about the error:
[Sat Jan 3 00:02:51 1998] access to /usr/local/www/cgi-bin/cgiwrap
failed for
reason: malformed header from script. Bad header=Scalar found where
operator ex 

I'm trying to use 
    print "<SELECT NAME="$cclor">\n";
    print "<OPTION>blue\n";
    print "<OPTION>yellow\n";
    print "<OPTION>red\n";
    print "<OPTION selected>white</SELECT><BR>\n";

this is in the pl itself which shows up in the browser as a html

Any help would be greatly appreciated
GregC/TechJD  techjd@ekn.net
--------------6D0596454D57486CB0CFFDEC
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Greg   Cobble
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Greg   Cobble
n:              Cobble;Greg  
email;internet: gregc@ekn.net
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------6D0596454D57486CB0CFFDEC--



------------------------------

Date: 3 Jan 1998 14:09:15 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Help wanted for new perl programmer
Message-Id: <68lgqb$sc5$1@uranium.btinternet.com>

In article <34ADF96C.30BBE556@ekn.net>, gregc@ekn.net says...
>
>This is a multi-part message in MIME format.
>--------------6D0596454D57486CB0CFFDEC
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit

Hey my Newsreader Dont do MIME.

>
>Hi I have some programming background (basic, fortran, cobol,(oldtimer
>lol) and  VB )
>perl and cgi are new to me 
>I'm working on a chat script and want to make the the user able 
>to change the background color , the script runs good with out this
>option , I'm getting 
>
>Internal Server Error
>
>The server encountered an internal error or misconfiguration and was
>unable to complete your request.
>
>Please contact the server administrator, [no address given] and inform
>them of the time the error occurred, and anything
>you might have done that may have caused the error.
>

This sounds like you are not Supplying a correct set of headers from your 
script: the bit of code you posted seems unlikely to cause the problem.  
This is not so much to do with perl as with CGI. Are you using CGI.pm (this 
simplifies sending headers).  Really this is a question for  
comp.infosystems.www.servers.<your platform here> or 
comp.infosystems.www.authoring.cgi.  

That vcard is a gift to spammers.

Have a good one.

Jonathan



------------------------------

Date: Sat, 03 Jan 1998 14:40:04 GMT
From: thijs@kink.xs4all.nl (Thijs Kinkhorst)
Subject: Re: Help wanted for new perl programmer
Message-Id: <68lik6$6sk$1@news2.xs4all.nl>

In article <34ADF96C.30BBE556@ekn.net>, Greg Cobble /TechJD <gregc@ekn.net>
writes:

[error 500]
>I'm trying to use 
>    print "<SELECT NAME="$cclor">\n";

You should precede those quotes behind NAME with backslashes:

    print "<SELECT NAME=\"$cclor\">\n";

BTW, please get rid of the vCard attached to all your messages.


-- 
Thijs Kinkhorst  * thijs@kinkhorst.com  *  http://www.kinkhorst.com/
ICQ 432406     "Omelette du Fromage" --Dexter       KeyID 0x371EFCB1
--- Fight Spam on the Internet! http://spam-mirror.cetis.hvu.nl/ ---


------------------------------

Date: Sat, 3 Jan 1998 03:42:46 +0000
From: Mark Worsdall <shadowweb@worsdall.demon.co.uk>
Subject: Re: How to check files exists and if it does then?
Message-Id: <9thyrcA2Obr0EwEZ@worsdall.demon.co.uk>

In article <waabtxznw1t.fsf@ese.UCSC.EDU>, "William R. Ward"
<hermit@cats.ucsc.edu> writes
>$file = "ipww01.proxy.aol.com/16December1997-Tuesday.txt";
>$file =~ s/^([^\.]+)\.(.*)\.txt$/$2-$1.txt/;
>
>Then $file contains "proxy.aol.com/16December1997-Tuesday-ipww01.txt"
>which is probably more useful anyway....

Can you expand/explain each digit/dubberry in:-
>s/^([^\.]+)\.(.*)\.txt$/$2-$1.txt/;

s/ (No problem)
^([ (Why?)
^\.]+)\.(.*)\.txt$ (why?)

and the last bit (why ?)

Checked my perl book & FAQ, describes and explains, but not to me.:(
-- 
Mark Worsdall (Webmaster) - WEB site:- http://www.shadow.org.uk
Shadow:- webmaster@shadow.org.uk    
Home  :- shadowweb@worsdall.demon.co.uk
Any opinion given is my own personal belief...


------------------------------

Date: Sat, 03 Jan 1998 15:44:36 -0800
From: Xu Cheng <xucheng@iscs.nus.edu.sg>
Subject: How to set semaphore value in Perl?
Message-Id: <34AECD64.AF7@iscs.nus.edu.sg>

Hi! I need to set semaphore value in my Perl script. I use semctl
$semid, $semnum, SETVAL, $arg; to do it. But in C function semctl, which
Perl semctl calls, the fourth argument is of the type of union { int;
struct semid_ds * ; u_short * ; } If I just pass an int into it, on some
machines a Bus Error is generated. I tried to use pack to produce a
valid argument for semctl, but I don't know what template to use. Can
somebody help me? How can I set a semaphore value in Perl?


------------------------------

Date: Sat, 03 Jan 1998 02:51:49 -0500
From: Andy Engle <engleae@fred.net>
Subject: Re: I need money [Re: I need a script]
Message-Id: <34ADEE15.5EA1640A@fred.net>

Joseph N. Hall wrote:

> I have a bank account that I want to have users add money.  It would
> be great if someone could send money to it, using the $20 and $50
> format please
> 
> Help me,
> and also email with the amount you are sending thank you
> 
>         -joseph
> 
>         :-)

Are you nuts?! What does this have to do with Perl?


Andy


------------------------------

Date: Sat, 03 Jan 1998 03:58:01 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: I need money [Re: I need a script]
Message-Id: <comdog-ya02408000R0301980358010001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34ADDDBB.DF4D1B57@5sigma.com>, joseph@5sigma.com posted:

>I have a bank account that I want to have users add money.  It would
>be great if someone could send money to it, using the $20 and $50
>format please 

your rates have a granularity of $20?

>Help me,
>and also email with the amount you are sending thank you

doesn't your bank send you a nice little notice after a wire transfer? 
or maybe we should all get FV or CyberCash accounts for these 
situations :)

-- 
brian d foy                                  <comdog@computerdog.com>
Fifth Avenue on Fire! <URL:http://computerdog.com/brian/fire/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


------------------------------

Date: Sat, 03 Jan 98 08:14:09 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: perl is c worsened (was: Re: word wrap routine)
Message-Id: <34ae3b66$1$ofn$mr2ice@speaker>

In <qz$9801020242@qz.little-neck.ny.us>, on 01/02/98 at 08:40 AM,
   Eli the Bearded <*@qz.to> said:
+-----
 This is not an example of readible code, no. But Pascal's or Modula-3's or |
whatever's lack of dominance in any programming except school work points to |
an evolutionary disadvantage against verbose languages. Crystals that have
+--->8

Unfortunately, COBOL puts a dent in your argument.

| people will ever master. Offhand, I suspect Randal himself might not know
| gut-feeling the output of this simple sequence:
| 	#!/usr/bin/perl -w
| 	$_ = qq ' fun \n' ;
| 	s #\w+# NY PM # && s
| 	/ \w+ / just some new york perl hackers /xg ;
| 	print ;
| 	__END__
+--->8

I'd tend to disbelieve that --- because *I* understood it.

| hopes he has broken Ilya's emacs syntax highlighting of s/// again
+--->8

That one's almost inevitable.  (Then again, I'm of the opinion that Emacs'
syntax parsing is hopelessly deficient anyway.)

-- 
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)



------------------------------

Date: Sat, 3 Jan 1998 08:23:17 -0500
From: "Webmaster" <webmaster@fccj.cc.fl.us>
Subject: Re: Perl Trick?
Message-Id: <34ae3c89.0@usenet.fccj.cc.fl.us>

You guys are weird :-)

Make perl the page you want to execute - as was said - when does that need
to be done?

Beaten to death I say :-)

HTH,
Bill

brian d foy wrote in message ...
>In article <34AC935B.E2E575CD@NOSPAMMING.cs.odu.edu>, Eddie Brown
<eddie@NOSPAMMING.cs.odu.edu> posted:
>
>>Besides having a java program execute a perl prog: does anyone know
>>of a way of having a perl program execute as soon as a page is accessed?
>
>depends on what a page is...
>
>but it likely has nothing to do with Perl.  it's probably the same
>answer as getting anything to execute at the right time.  there is
>probably a better newsgroup for this question. :)
>
>--
>brian d foy                                  <comdog@computerdog.com>
>CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>




------------------------------

Date: 03 Jan 1998 07:17:55 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: jbattikha@highsynth.com
Subject: Re: PERLIPC - FIFO: parent, child, stalled!
Message-Id: <8c1zyp1w18.fsf@gadget.cscaper.com>

>>>>> "Jihad" == Jihad Battikha <jbattikha@highsynth.com> writes:

Jihad> I'll have an SSL option for people.  Beyond that, I really don't have
Jihad> that much control over data traversing the 'Net in plaintext on it's way
Jihad> to the web server (even with SSL since SSL is really only a verification
Jihad> system, not a real-time encryption system).

That's very odd.  Either I'm completely out of whack, or SSL is both
an encryption system *and* an authentication system (server to
browser).

What makes you think the enroute data is not encrypted?

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 241 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


------------------------------

Date: Sat, 03 Jan 1998 09:00:38 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: recomended Perl books ?
Message-Id: <34adf026.524144494f47414741@radiogaga.harz.de>

Tiago Stock (tiagosdelete@gdn.net) wrote:
: Please follow this thread in recommending your favorite Perl reference book.

: I'm just starting and would like input from more experienced users in which
: book to buy.

If you are a past-the-newbie-stage (C, C++, or Java) programmer, I'd recommend

Nigel Chapman: Perl - The Programmer's Companion
John Wiley & Sons, 1997
ISBN 0-471-97563-X

plus the Camel book for reference.

It's an (IMHO) excellent example-driven introduction to Perl concepts,
written for people who already know how to solve problems using programs
and would like to see how it's done in Perl.

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


------------------------------

Date: 03 Jan 1998 07:14:04 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: mocat@best.com (jay)
Subject: Re: recomended Perl books ?
Message-Id: <8c67o11w7n.fsf@gadget.cscaper.com>

>>>>> "jay" == jay  <mocat@NOSPAM.best.com> writes:

jay> So I recommend going out and purchasing Learning PERL and
jay> Programming PERL at the same time.  One is sparse in areas, the
jay> other has lots of info and such.

For some reason, I cannot disagree with you. :-)

jay> If you plan on doing a lot of text manipulation, should take a
jay> look at Mastering Regular Expressions (O'reiley too) and look at
jay> the perlre manpage.

Jeffrey Friedl's MRE is a Very Good Book.  I've been hacking regular
expressions for 20 years now (using Unix since 1977), and I *still*
learned a surprising amount of stuff from this book.  Congrats, Jeffrey!

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 241 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


------------------------------

Date: Fri, 02 Jan 1998 22:23:57 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: recomended Perl books ?
Message-Id: <34ADCB1D.C93F3465@5sigma.com>

Learning Perl is an excellent tutorial introduction to Perl.
Programming Perl isn't perfect, but it is the official reference.
Just about everything in Programming Perl is on-line in one form
or another, and generally a few more months up-to-date too.

Advanced Perl Programming is a pretty good "advanced" Perl book.
I'd like to think that my book, Effective Perl Programming, isn't
all that bad either.  The two have some overlap but not so much
that it wouldn't be worthwhile to own both.  :-)

	-joseph
	 http://www.effectiveperl.com


Advanced Perl Programming

Michael Ng wrote:
> 
> Programming Perl and Adv. Perl Programming.
> 
> Tiago Stock (tiagosdelete@gdn.net) wrote:
> ::> Please follow this thread in recommending your favorite Perl reference book.


------------------------------

Date: Sat, 03 Jan 1998 03:09:25 GMT
From: djboyd@sam.on-net.net
Subject: Return value of system
Message-Id: <34adabbe.501060@news.on-net.net>

What are the return values for the system call.  The references  I
have do not say.


------------------------------

Date: 03 Jan 1998 07:25:04 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: djboyd@sam.on-net.net
Subject: Re: Return value of system
Message-Id: <8cwwghzlbz.fsf@gadget.cscaper.com>

>>>>> "djboyd" == djboyd  <djboyd@sam.on-net.net> writes:

djboyd> What are the return values for the system call.  The references  I
djboyd> have do not say.

Methinks you are using the wrong references then. :-)

"man perlfunc" =>

     system LIST
             Does exactly the same thing as "exec LIST" except
             that a fork is done first, and the parent process
             waits for the child process to complete.  Note that
             argument processing varies depending on the number
             of arguments.  The return value is the exit status
             of the program as returned by the wait() call.  To
             get the actual exit value divide by 256.  See also
             the exec entry elsewhere in this document .  [...]

[...]

     wait    Waits for a child process to terminate and returns
             the pid of the deceased process, or -1 if there are
             no child processes.  The status is returned in $?.

Well, OK, it's a little bit of a runaround.  Now next:

"man perlvar" =>

     $?      The status returned by the last pipe close, backtick
             (``) command, or system() operator.  Note that this
             is the status word returned by the wait() system
             call (or else is made up to look like it).  Thus,
             the exit value of the subprocess is actually ($? >>
             8), and $? & 255 gives which signal, if any, the
             process died from, and whether there was a core
             dump.  (Mnemonic: similar to sh and ksh.)

"man -s2 wait" => (On Solaris 2.5.1, but others are similar):

     If wait() returns because the status of a child  process  is
     available,  it  returns the process ID of the child process.
     If the calling process had specified a  non-zero  value  for
     stat_loc,  the status of the child process will be stored in
     the location pointed to by stat_loc.  It  may  be  evaluated
     with  the  macros  described on wstat(5).  In the following,
     status is the object pointed to by stat_loc:

          If the child process stopped, the high order 8 bits  of
          status  will  contain  the  number  of  the signal that
          caused the process to stop and the  low  order  8  bits
          will be set equal to WSTOPFLG.

          If the child process terminated due to an _exit() call,
          the  low  order 8 bits of status will be 0 and the high
          order 8 bits will contain the low order 8 bits  of  the
          argument  that the child process passed to _exit(); see
          exit(2).

          If the child process terminated due to  a  signal,  the
          high order 8 bits of status will be 0 and the low order
          8 bits will contain  the  number  of  the  signal  that
          caused  the  termination.  In  addition, if WCOREFLG is
          set, a  "core  image"  will  have  been  produced;  see
          signal(3C).

There, all available right in front of you. :-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 241 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


------------------------------

Date: Sat, 03 Jan 1998 11:01:58 -0500
From: oberon <oberon@nospam.erols.com>
Subject: time module?
Message-Id: <34AE60F6.1BC06EED@nospam.erols.com>

Is there a perl module for frobbing with units of time?  i.e Functions
to add 04:00:23 and 00:01:45, and other useful manipulations.  I've
hunted around the CPAN directory, but nothing looked hopeful.

On a different, but related topic:  I've been lurking here for some time
now (>4 months), and have seen many persons "chastised" for asking a
question to which a perusal of the perlfaq would have answered.  So,
I've made an effort to try to find faq's with previously published
answers to my questions.  It has helped me many times.  But, finding a
related faq is rather difficult, given that many of the topics read like
this: "How_can_I_count_the_n.."  I think most would agree that this is
non-intuitive.  :)  Is there a list of complete faq topics?

--oberon
Kenneth Taborek
oberon at erols dot com


------------------------------

Date: Wed, 31 Dec 1997 00:28:50 GMT
From: sbc@iol.it (Bud Bundy)
Subject: Unexpected problem with the query string
Message-Id: <34a98e52.8387696@mikasa.iol.it>

It should be easy, but it doesn't work :-(

I have a script being called by a hyperlink like this:
http://host.com/cgi-bin/c.pl?26

Considering that the argument after the question mark is only a number
(no forbidden chars).

So I'd expect to be able to detect the value with a line like this:
QUERY_STRING == 26

But the QUERY_STRING is empty! What am I doing wrong?

Thanks



------------------------------

Date: Sat, 03 Jan 1998 03:52:43 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: word wrap routine
Message-Id: <comdog-ya02408000R0301980352430001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34AD97D0.CC3D4530@_remove_to_send_email_.cisco.com>, Kuntal Daftary <daftary@_remove_to_send_email_.cisco.com> posted:

>Tom Phoenix wrote:
>
>> > # why does everyone want to try to re-invent Text::Wrap?
>> >
>> > It was a 'quick and dirty solution'.  It wasn't really meant to work
>> > perfect but just give an idea to the poster.
>> 
>> Compared to posting buggy code, it would have been better to give the
>> poster the idea of using a module, don't you agree?
>
>yes. but sometimes not everyone is aware that a "module" exists for
>some
>particular task. 

Text::Wrap is recommended at least five times a week.  a perusal
of CPAN is a good thing - every perl programmer should look 
through it just to see what is there.  later, when one needs
something, one might remember seeing a module for that task.
besides, almost anything has module.

>besides, people like me (i m not aware if there any
>out
>there) who (presently) shirk from anything OOPS oriented might not
>want
>to use a module (just a psychological thing rather than anything
>else).

Text::Wrap isn't a class.  it is simply exportable functions.  even
if you don't want to use the module itself, you can look at the 
code inside it - it's very tractable, unlike some other modules.


>finally, these are jsut opinions. isnt it better that the questioner
>gets
>multiple opinions: sureshot modules as well as QND snippets and
>himself
>figures out what best suites his situation?


this would be fine if the other suggestions were sensible.  in this
case, broken and buggy code was the other suggestion.  if one is
going to post code, test it!  one's snippet is going to be seen by
lots and lots of people, and tried by at least some of them.  if the
snippet doesn't work, some people will be confused - after all, if they
knew how to do it themselves they wouldn't be asking the question.


>finally, it is not correct to post condenscending stuff just cuz he
>knows
>perl better than the lesser mortals (like me)
>
>        "why does everyone want to try to re-invent Text::Wrap?"

part of the problem is the perception of the reader, although
i was a bit miffed when i posted that message.  it gets really
annoying to watch people post code that won't work, especially
when they didn't take the time to test it.  this makes it harder
to help others because they don't realize what's good and 
what's bad.  some of us are here to help others, and watching 
bad code lead people down the wrong path is very frustrating.

in this case, the re-invention of Text::Wrap is a classic scenario
since each new "inventor" seems to make the same mistakes and
post the same unworkable code.

-- 
brian d foy                                  <comdog@computerdog.com>
Fifth Avenue on Fire! <URL:http://computerdog.com/brian/fire/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
  feels like Sisyphus


------------------------------

Date: Tue, 30 Dec 1997 21:58:22 -0800
From: Peter Prymmer <pvhp@forte.com>
To: Samuel Costa Bendicho <sc1334@speedy.udg.es>
Subject: Re: WWW database
Message-Id: <34A9DEFE.22FC@forte.com>

Samuel Costa Bendicho wrote:
> 
> Hi there!
> 
> I have to design a web with a little database accessible through CGI
> 
> I had in mind using Perl. Do you know what kind of database should I
> use?

No I do not know what kind of database you should use.

> I'd like to know if there exist some kind of perl libraries to work with
> some standard type of database.


Have you taken a look at the web page at:

   http://www.hermetica.com/technologia/DBI/

?  There is a great deal of discussion of perl used with various
databases there.  Good luck.


Peter Prymmer


------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 1574
**************************************

home help back first fref pref prev next nref lref last post