[10442] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4035 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 21 14:04:05 1998

Date: Wed, 21 Oct 98 11:00:27 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 21 Oct 1998     Volume: 8 Number: 4035

Today's topics:
        %SIG handlers for CGI (Bart Lateur)
    Re: %SIG handlers for CGI <rootbeer@teleport.com>
    Re: Backgrounding long processes? <bn711@freenet.carleton.ca>
    Re: Can WinPerl interact with ODBC driver? <ahongun@ecsysinc.com>
    Re: Displaying the Time <tchrist@mox.perl.com>
        emacs cperl-mode and indent <jdhunter@nitace.bsd.uchicago.edu>
    Re: From scalar to array to output?? <dgris@rand.dimensional.com>
    Re: From scalar to array to output?? (Craig Berry)
    Re: From scalar to array to output?? (Larry Rosler)
    Re: From scalar to array to output?? <rootbeer@teleport.com>
    Re: From scalar to array to output?? <dgris@rand.dimensional.com>
    Re: Help with subroutines <rootbeer@teleport.com>
    Re: Implementing an ordered queue (Matt Knecht)
    Re: Implementing an ordered queue (M.J.T. Guy)
        Pattern Matching: Escaping Period Character <chi@cybie.com>
        perl & Mysql <iqbal@orangenet.co.uk>
    Re: Perl & Y2K - booby trap code <keithmur@mindspring.com>
    Re: Perl & Y2K - booby trap code <aas@sn.no>
    Re: Perl & Y2K - booby trap code <gnat@frii.com>
    Re: Perl & Y2K - booby trap code (Craig Berry)
    Re: PERL and a DATABASE.. <baughmankr@appstate.edu>
        Perl Book Reviewers briley@manning.com
    Re: Perl Cookbook - is this the best perl book? (PM Jenkins)
    Re: Perl Cookbook - is this the best perl book? <dgris@rand.dimensional.com>
    Re: Perl Cookbook - is this the best perl book? (Chris Nandor)
    Re: Perl Cookbook - is this the best perl book? (Larry Rosler)
    Re: Perl DBI AND Oracle (ORACLE_HOME) (thanks) (John D Groenveld)
    Re: perl newbie trying to reference pseduoarray, better (Mark-Jason Dominus)
    Re: perl newbie trying to reference pseduoarray, better (David Alan Black)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 21 Oct 1998 17:55:35 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: %SIG handlers for CGI
Message-Id: <362e1d9a.32802638@news.ping.be>

Some people would argue that this is a CGI question, not a Perl
question. Oh well: I'm wondering about what Perl CGI scripts do when
they transfer a rather large file to the browser, and the user
interrupts the transfer.

I've tried to experiment a little using %SIG handlers, but the ones I
tested don't seem to work for this kind of application. I think that
using some of those isn't too safe, I wouldn't want to crash my server.

Here's the complete list. Can anybody tell me what they're for?

 ABRT ALRM BUS CHLD CONT EMT FPE HUP ILL INFO
 INT IO IOT KILL PIPE PROF QUIT SEGV STOP SYS
 TERM TRAP TSTP TTIN TTOU URG USR1 USR2 VTALRM WINCH
 XCPU XFSZ

I tried INT, ABRT, QUIT, STOP, and somebody suggested PIPE in an old
thread in Dejanews; none seem to ever get triggered.

My experiments indicate that the script seems to quit, i.e. it never
gets to the end where it stores some text in a log file, but it might
well be that I just got a zombie script that remains in the server
forever, waiting for STDOUT to become unblocked. Should I install a ALRM
handler for that case?

BTW my current server is running FreeBSD v2.6(?), but I'm currious about
other Unix flavours as well.

	Bart.


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

Date: Wed, 21 Oct 1998 17:38:10 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: %SIG handlers for CGI
Message-Id: <Pine.GSO.4.02A.9810211034450.5534-100000@user2.teleport.com>

On Wed, 21 Oct 1998, Bart Lateur wrote:

> I'm wondering about what Perl CGI scripts do when they transfer a
> rather large file to the browser, and the user interrupts the
> transfer.

How does the script know that the user interrupted it? If your server
sends a signal, then it's simple to find out what the program does. If
there's no signal, though, the program probably runs normally. In any
case, there's nothing Perl-specific about that; the same thing should
happen with any programming language.

> Here's the complete list. Can anybody tell me what they're for?
> 
>  ABRT ALRM BUS CHLD CONT EMT FPE HUP ILL INFO

Yes, your system's manpages explain these.

> I tried INT, ABRT, QUIT, STOP, and somebody suggested PIPE in an old
> thread in Dejanews; none seem to ever get triggered.

Well, if your server doesn't send a catchable signal, there's not much
that a Perl newsgroup can do about it. Oh well!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 21 Oct 1998 12:50:18 -0400
From: David Huggins-Daines <bn711@freenet.carleton.ca>
Subject: Re: Backgrounding long processes?
Message-Id: <87yaq9q2ph.fsf@freenet.carleton.ca>

"David C. Vongrad" <dvongrad@freerealtime.com> writes:

> This doesn't work, as exec terminates the Perl script and executes another
> program in place of it. I should mention that the child process will most
> likely outlive the parent, so this may make a difference. I've also tried
> "fork", but no luck.

Here's how you can make sure the child won't ever die:

# fork once
unless (fork()) {
  # defensive programming
  die "Can't fork: $!" if $!;

  # in child process, fork again
  exit 0 if fork();
  die "Can't fork: $!" if $!;

  # in child of child process - won't die when parent exits
  exec ('/usr/bin/yes', "You can't kill rock 'n roll");
}

Note that /usr/bin/yes can only be killed by a signal, so make sure
you have another shell handy to kill it if you try this one out :-)

Cheers


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

Date: Wed, 21 Oct 1998 10:01:44 -0700
From: "A. H. Ongun" <ahongun@ecsysinc.com>
Subject: Re: Can WinPerl interact with ODBC driver?
Message-Id: <70l43n$p3h$1@news-2.news.gte.net>

Hi,

You don't need any backdoor methods.  Oracle (they purchased RDB from DEC a
few years ago)  has an ODBC driver that connects to RDB, assuming your host
machine is running TCP/IP.  At one time it was available on their web site
(it was buried pretty deep).

We've have used it at the time and it worked.

Once, you have the ODBC connection, it is not any different than any ODBC
source, which means you can use Perl ODBC module to connect to it.

Hope this helps,

Andy O.
ECSI

metcalfjm@my-dejanews.com wrote in message
<70kvlk$1d5$1@nnrp1.dejanews.com>...
>Hi,
>
>I have a very odd situation that calls for backdoor methods.
>I am trying to communicate with a DEC-Rdb v6.0 relational
>database on a VAX system.  The Rdb version does not use
>Sql-Net and there are no DBD::* or DBI::* perl modules
>to communicate with it.  However, someone has suggested
>an alternative:
>
>It has come to my attention that current versions of
>Microsoft's ODBC driver(s) for Win95/98/NT can communicate
>with a DEC-Rdb v6.0+ database.  Can anyone else confirm
>this?  If so, does anyone know if/how I can develop code
>in WinPerl to take advantage of this capability?
>
>Thanks in advance for any replies?
>
>Regards,
>
>JM
>-----
>Jeffrey M. Metcalf
>Clinical Systems Analyst
>Pfizer, Inc
>metcalfjm@my-dejanews.com
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




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

Date: 21 Oct 1998 17:28:13 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Displaying the Time
Message-Id: <70l5jd$arh$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Gareth Ennis <gary.ennis@strath.ac.uk> writes:
:Unfortunately - i have discovered that Perl 4 (which we still use here)
:does not support localtime.

One: that's not true.  It just doesn't convert the scalar context call to
    ctime.  Hence ctime.pl

Two: STOP USING PERL4 NOW!

--tom
-- 
    "You can't have filenames longer than 14 chars.  
     You can't even think about them!"
        --Larry Wall in Configure from the perl distribution


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

Date: Wed, 21 Oct 1998 17:17:21 GMT
From: John Hunter <jdhunter@nitace.bsd.uchicago.edu>
Subject: emacs cperl-mode and indent
Message-Id: <1rk91thm1q.fsf@cace.bsd.uchicago.edu>


I use cperl-mode v4.6 on gnu emacs 20.2.1 and have a problem with the
indent feature.

In the expression below cperl will not indent any of the lines.

use vars qw(
@filelist $image $images $montage 
$opt_t $opt_f 
$outfile $tar
$name $path $suffix);


I would like something like:

use vars qw(@filelist $image $images $montage 
	    $opt_t $opt_f 
	    $outfile $tar
	    $name $path $suffix
	    );

I get the following error message:
End of `qw( ... )' string/RE not found: (scan-error Unbalanced 
parentheses 238 1098)

Is this a bug and if so has anyone fixed it?  Or is there a variable I
can tweak to fix this problem?

JDH

-- 
John D. Hunter			h:(773) 288-3970
University of Chicago		w:(773) 702-5857




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

Date: Wed, 21 Oct 1998 17:25:35 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: From scalar to array to output??
Message-Id: <m3hfwx4yxn.fsf@rand.dimensional.com>

Kinney Baughman <baughmankr@appstate.edu> writes:

First, I want to say that this is a _perfect_ post.  You explained
what you are trying to do, what you've tried, and what you expected
it to do.  Thank you :-).

> I have phone numbers stored in a database in the form: 1234567890
> 
> I want to collect the value of a phone number and output it in the form
> of: (123) 456-7890.
> 
> So far, here is what I have:
> 
> -----
> $phone=8282977837;
> @nph = split(//, $phone);
> 
> print "(@nph[0]@nph[1]@nph[2])
> nph[3]@nph[4]@nph[5]\-@nph[6]@nph[7]@nph[8]@nph[9]\n";
        ^     ^         ^      ^      ^      ^
This isn't what you want.  You are taking an array slice
each time, rather than specifying a single scalar value.
Changing the @s to $s would make this more correct, but 
there are other, better, ways to do this.

>
> Surely there is a better solution than this.

Yes, and it's spelled substr(). 

my $phone  = 1234567890;
my $ac     = substr ($phone, 0, 3);
my $prefix = substr ($phone, 3, 3);
my $end    = substr ($phone, 6);

print "($ac) $prefix-$end\n";

> I've tried, for example, to index the @aph array to pick out the area
> code with:
> 
> $ac=@phone[0,1,2];

You are assigning a comma-separated list to a scalar variable.  This
results in the variable being assigned the last value in the list.

> Thanks for any help.

No problem.

dgris
-- 
Daniel Grisinger          dgris@perrin.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 21 Oct 1998 17:30:56 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: From scalar to array to output??
Message-Id: <70l5og$249$3@marina.cinenet.net>

Kinney Baughman (baughmankr@appstate.edu) wrote:
: I'm hoping someone can give me a more elegant solution than the one I've
: been able to concoct myself.
: 
: My problem.
: 
: I have phone numbers stored in a database in the form: 1234567890
: 
: I want to collect the value of a phone number and output it in the form
: of: (123) 456-7890.

Presuming 'compressed' phone number is in $_, and leaving aside all error
checking (i.e., assume $_ *must* contain exactly 10 digits and nothing
else):

  my ($area, $exchange, $line) = /(\d{3}))(\d{3})(\d{4})/;
  print "($area) $exchange-$line";

HTH!

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Wed, 21 Oct 1998 10:24:14 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: From scalar to array to output??
Message-Id: <MPG.1097b89edddd456598982f@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <362E0D59.9CF05560@appstate.edu> on Wed, 21 Oct 1998 12:35:37 
-0400, Kinney Baughman <baughmankr@appstate.edu> says...
> I'm hoping someone can give me a more elegant solution than the one
> I've been able to concoct myself.
 ...
> I have phone numbers stored in a database in the form: 1234567890
> 
> I want to collect the value of a phone number and output it in the form
> of: (123) 456-7890.

perldoc -f substr

is the most straightforward way -- pull out the three pieces and print 
them as strings, to avoid losing leading zeros.

But here is (IMO) the most elegant way:

printf "(%s) %s-%s\n", unpack 'A3 A3 A4', $input;

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 21 Oct 1998 17:33:31 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: From scalar to array to output??
Message-Id: <Pine.GSO.4.02A.9810211032470.5534-100000@user2.teleport.com>

On Wed, 21 Oct 1998, Kinney Baughman wrote:

> I have phone numbers stored in a database in the form: 1234567890
> 
> I want to collect the value of a phone number and output it in the form
> of: (123) 456-7890.

I'd use a s/// operator. See the perlop and perlre manpages. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 21 Oct 1998 17:44:20 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: From scalar to array to output??
Message-Id: <m37lxt4y2o.fsf@rand.dimensional.com>

Tom Phoenix <rootbeer@teleport.com> writes:

> On Wed, 21 Oct 1998, Kinney Baughman wrote:
> 
> > I have phone numbers stored in a database in the form: 1234567890
> > 
> > I want to collect the value of a phone number and output it in the form
> > of: (123) 456-7890.
> 
> I'd use a s/// operator. See the perlop and perlre manpages. Good luck!

That's intersting, it didn't even occur to me to use s/// 
for this.  I'm wondering why you'd pick s/// over substr 
(my original thought) or unpack (Larry's nice solution (btw, 
I'm becoming a big fan of unpack :-)).

This just looks too cluttered to me-

    $phone =~ s/^(\d{3})(\d{3})(\d{4})$/($1) $2-$3/;

and I was curious why you prefer this (or if you have a different use
of s/// in mind, every other one I came up with looked even worse).

dgris
-- 
Daniel Grisinger          dgris@perrin.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Wed, 21 Oct 1998 16:37:48 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help with subroutines
Message-Id: <Pine.GSO.4.02A.9810210937110.5534-100000@user2.teleport.com>

On Wed, 21 Oct 1998 prakashpatel@hotmail.com wrote:

>  cgi-lib.pl did not return a true value at test_sub.cgi line 2.

Why did you post this twice? Why aren't you using CGI.pm? But that message
is documented in the perldiag manpage. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 21 Oct 1998 17:33:15 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Implementing an ordered queue
Message-Id: <vVoX1.63$6J3.1078827@news2.voicenet.com>

M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
>Matt Knecht <hex@voicenet.com> wrote:
>>
>>Keeping this in an array is a poor choice.  Inserting an element would
>>require shuffling all array elements back a step.
>
>The whole point of a heap is that you only need to shuffle O(log n)
>elements to make an insertion (or deletion).

Actually, a binary tree is working for me quite nicely.  Heap.pm looks
interesting, though.  I understand binary trees ... I don't know much
about heaps.

>>Using a large, sparse array is a poor choice (I think) because then I'd
>>have to worry about fragmentation.  I'd rather not re-invent malloc. :)
>
>A heap is implemented as a *dense* array.    A heap with n elements is
>stored in an array of size n.
>
>You need to go away and read the textbooks on how a heap works.    Or just
>use Heap.pm as a black box.

Go away?  Just to read technical manuals?  Wish I could! :)

Unfortunately, Heap.pm hasn't evolved to a black box state.  I had to
go into the code to figure out what to do as the docs are incorrect and
spotty.

-- 
Matt Knecht - <hex@voicenet.com>


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

Date: 21 Oct 1998 16:52:26 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Implementing an ordered queue
Message-Id: <70l3ga$jd4$1@pegasus.csx.cam.ac.uk>

Matt Knecht <hex@voicenet.com> wrote:
>
>Keeping this in an array is a poor choice.  Inserting an element would
>require shuffling all array elements back a step.

The whole point of a heap is that you only need to shuffle O(log n)
elements to make an insertion (or deletion).

>Using a large, sparse array is a poor choice (I think) because then I'd
>have to worry about fragmentation.  I'd rather not re-invent malloc. :)

A heap is implemented as a *dense* array.    A heap with n elements is
stored in an array of size n.

You need to go away and read the textbooks on how a heap works.    Or just
use Heap.pm as a black box.


Mike Guy


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

Date: Wed, 21 Oct 1998 10:02:28 -0700
From: Chi Yu <chi@cybie.com>
Subject: Pattern Matching: Escaping Period Character
Message-Id: <362E13A4.7F0E0E09@cybie.com>

Greetings,

Can some kind soul please tell me how to match on a period (the
character period) in a regular expression? A bare period in the regular
expression is interpreted as a match against any single character except
the newline character - that's not what I want.

I want to find periods in a string. Must I use an escape character for
the period? What would that be? I am specifically trying to match data
in the following format:

   nn.nn where n is a digit

Thanks,
Chi Yu


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

Date: Wed, 21 Oct 1998 17:34:00 +0100
From: iqbal <iqbal@orangenet.co.uk>
Subject: perl & Mysql
Message-Id: <362E0CF8.8E347E88@orangenet.co.uk>

Hi

I have perl with Mysql working fine on one machine. I now want to be
able to send, receive data from this machine, to/from another machine
using perl scripts.

However i do not want to install mysql on the second machine, is there a
way round this, or do I need to install mysql on all my machne, before I
can get them to talk to the database on one of them.

Thanks

Iqbal


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

Date: Wed, 21 Oct 1998 11:37:32 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <362E0DCC.AECB5A4B@mindspring.com>

The biggest problem I have with the article is that the reasoning is
confused.  It contains the following two statements:

"It is not uncommon for the year handling in these languages to be
misunderstood and therefore misused.
    The booby-trapped year value does not give the full four digits of
the year but instead returns what
    appears to be the last two digits only."

This would seem to be a correct statement of the "problem", disregarding
the value-laden term "booby-trapped".

However, she(?) goes on to say things like:
"To test the extent of the problem within certain languages, I used a
search engine to locate examples of "get year" on the Internet."

and, 

"A common response was "Problem? What problem?" from programmers who
understood the correct use of year values but who were reluctant to
concede that their language could cause any year 2000 problem."

The problem here is that in the first sentence she locates the problem
*within* the language, when she clearly shows elsewhere that the problem
is with programmers' misunderstanding of the language.  She then goes on
to assert that programmers are in denial when they refuse to concede
that their language causes the problem.  Again, the *language* does not
cause the problem; the incorrect use of it does.

I suspect that the programmers in question know that there is a real
problem out there, but react immediately to the imprecise assertion. 

It's actually not a bad article, discounting those lapses of precision
in language.  I don't think her general import is to blame Perl or any
other language, but to point out a problem in existing code.  It's just
too bad she has to get everybody's back up unnecessarily.

finsol@ts.co.nz wrote:
> 
> I posted a link in an earlier thread on this topic - unfortunately the link
> was changed & the article referenced had nothing to do with Perl - it did
> spark off an lively discussion however!
> 
> The correct link for this article (unless they change it again!) is:
> http://www.idg.co.nz/WWWfeat/Y2000/amon1010.htm
>


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

Date: 21 Oct 1998 18:25:45 +0200
From: Gisle Aas <aas@sn.no>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <m3soghop9y.fsf@furu.g.aas.no>

Randal Schwartz <merlyn@stonehenge.com> writes:

> There is nothing WRONG with MacPerl, or any other flavor of Perl.
> localtime() and gmtime() have *always* returned year - 1900 starting
> with perl version 0.  And was documented as such.
> 
> If a sloppy programmer wrote "19$year" instead of ($year + 1900),
> that's *their* fault.  STOP BLAMING PERL.

We never see these Y2K threads in comp.lang.python.  I conclude that
something must be wrong with Perl.  I really wished Larry had decided
to fix the struct values like Gudio did.

We could fix this with a pragma too. Something for Ilya's 'use pedantic'?

-- 
Gisle Aas


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

Date: 21 Oct 1998 10:37:49 -0600
From: Nathan Torkington <gnat@frii.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <5qg1chdg6a.fsf@prometheus.frii.com>

Randal Schwartz <merlyn@stonehenge.com> writes:
> STOP BLAMING PERL.
> 
> STOP PROPOGATING NONSENSE.
> 
> <sigh>

And in the first reported incident of IP-directed possession, Tom
Christiansen today assumed the body of the corporal entity known as
Randal Schwartz, and posted to comp.lang.perl.misc.  Microsoft stock
closed up 3/16 in moderate trading.

Nat


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

Date: 21 Oct 1998 17:24:59 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <70l5db$249$2@marina.cinenet.net>

Gisle Aas (aas@sn.no) wrote:
: Randal Schwartz <merlyn@stonehenge.com> writes:
: > There is nothing WRONG with MacPerl, or any other flavor of Perl.
: > localtime() and gmtime() have *always* returned year - 1900 starting
: > with perl version 0.  And was documented as such.
: > 
: > If a sloppy programmer wrote "19$year" instead of ($year + 1900),
: > that's *their* fault.  STOP BLAMING PERL.
: 
: We never see these Y2K threads in comp.lang.python.  I conclude that
: something must be wrong with Perl.  I really wished Larry had decided
: to fix the struct values like Gudio did.

'Fix' is the wrong term.  Perl's localtime() is just a wrapper for C/Unix
localtime(), which has, throughout history, returned year-1900.  To my way
of thinking, continuing to provide the behavior everyone who's ever coded
in C or under Unix expects already is a Good Thing.  I would be very
unhappy having to switch between different expectations about localtime in
different closely related languages. 

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Wed, 21 Oct 1998 12:24:39 -0400
From: Kinney Baughman <baughmankr@appstate.edu>
Subject: Re: PERL and a DATABASE..
Message-Id: <362E0AC7.A2A71015@appstate.edu>



Tony Curtis wrote:

> Re: PERL and a DATABASE.., DPortal
> <webmaster_NO*SPUDS*@dportal.co.uk> said:
>
> DPortal> I would like to query a database using PERL (and
> DPortal> something like SQL), but I can only seem to be able
> DPortal> to do this on NT, does anyone know of any
> DPortal> UNIX/LINUIX database's that I can query using
> DPortal> PERL. (If there FREE then even better ;-) ).
>
> There are lots of DB interfaces in CPAN.  Look for the DBI
> and DBD directories, which will then indicate which
> databases these modules let you talk to.
>

I've been using MySQL (www.mysql.com) and interfacing it with Perl for a couple of
years.  You'll need the DBI and DBD modules mentioned above as well as the MySQL
modules.

Kinney Baughman




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

Date: Wed, 21 Oct 1998 16:19:00 GMT
From: briley@manning.com
Subject: Perl Book Reviewers
Message-Id: <70l1hl$3sq$1@nnrp1.dejanews.com>

Manning Publications Co. is developing a series of well focused Perl books and
would like to know if there are knowledgeable people who would like to act as
reviewers.  If interested please contact Brian Riley at briley@manning.com.
Thank You

--
Brian Riley
Publishing Assistant
Manning Publications Co.
Greenwich Ct.
(203)629-2211

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 21 Oct 1998 16:46:15 GMT
From: pmj@hotmail.com (PM Jenkins)
Subject: Re: Perl Cookbook - is this the best perl book?
Message-Id: <70l30i$4hd@ohnasn01.houston.omnes.net>

In article <70l16n$204@ohnasn01.houston.omnes.net>, pmj@hotmail.com (PM Jenkins) wrote:

>I suggest that people buy this book when the next
>release comes out.  There are SO MANY typos/bugs/... in this book
>(757 of them).  Probably you don't want to hand-fix them by marking
>over 757 spots. Nor do you want to attach/insert 27 pages of bug listing 
>in the book.  My guess is that after authors typed in, they never looked it
>back until the book printed out.  Authors argue that 757 bugs are very
>small comparing the size (less than 1 bugs / page !).  Gees what an
>attitude !!  I think that they owe an apology to the buyers for publishing
>such a screwed-up error-ridden version.
>One question that I had was, how come authors ended up typing


I forgot to say that

O'Reilly = lots of errors in the books, no quality control (= readers
               end up getting low quality books - regardless of the contents
               quality).






PM Jenkins


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

Date: Wed, 21 Oct 1998 17:06:21 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: Perl Cookbook - is this the best perl book?
Message-Id: <m3lnm94ztq.fsf@rand.dimensional.com>

pmj@hotmail.com (PM Jenkins) writes:

<snip troll>

The troll is dead.  Long live the troll!!

dgris
-- 
Daniel Grisinger          dgris@perrin.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Wed, 21 Oct 1998 13:23:34 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Perl Cookbook - is this the best perl book?
Message-Id: <pudge-2110981323350001@192.168.0.77>

In article <70l16n$204@ohnasn01.houston.omnes.net>, pmj@hotmail.com (PM
Jenkins) wrote:

# In article <70foh8$c13$1@nnrp1.dejanews.com>, paulwade@my-dejanews.com wrote:
# >In article <6vv8h6$799$1@nnrp1.dejanews.com>,
# >  lqyrms@nottingham.ac.uk wrote:
# >> Could anybody who has read the Perl Cookbook please tell me if this is the
# >> best perl book to get. There are a couple of reviews of this book at amazon
# >>  http://www.amazon.com/exec/obidos/ASIN/1565922433/bibs/  , but I would
# >> appreciate the views of the experts in this newsgroup too.
# >>
# >
# >Depends what you mean by 'best' and for what purpose. However, it is an
# >excellent book.
# 
# I suggest that people buy this book when the next
# release comes out.  There are SO MANY typos/bugs/... in this book
# (757 of them).  Probably you don't want to hand-fix them by marking
# over 757 spots. Nor do you want to attach/insert 27 pages of bug listing 
# in the book.  My guess is that after authors typed in, they never looked it
# back until the book printed out.  Authors argue that 757 bugs are very
# small comparing the size (less than 1 bugs / page !).  Gees what an
# attitude !!  I think that they owe an apology to the buyers for publishing
# such a screwed-up error-ridden version.
# One question that I had was, how come authors ended up typing
# variables in all CAPS ?  Are they MS-DOS or VMS users ?

1.  There are not 757 bugs.  That is a lie.  There are far less.  An
errata entry is not the same as a bug.  They note that there is about one
technical bug for every 20 pages.  Hardly what you said.

2.  They do not put variables in all caps.  That is also a lie.  Some
special variables are in all caps (constants, filehandles, hash keys,
etc.), but regular variables have no caps.  This is as per the perlstyle
manpage, which perhaps you could read (after you learn how to construct a
decent English sentence first, of course).

3.  As to ORA books being low quality, I fear you must have never picked
up any book before, let alone an ORA book.  They are consistently putting
out books with superior content, editing, materials, tyopgraphy, etc. than
anyone else in the business.  And The Perl Cookbook, while imperfect, is
an example of one of the highest quality books programming you can get
today.

Don't bother responding, because I've killfiled you.  I just wanted to
dispell your lies in case someone might be inclined to believe you.

  /me returns to the solace of clp.moderated

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Wed, 21 Oct 1998 10:48:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl Cookbook - is this the best perl book?
Message-Id: <MPG.1097be361c193e92989831@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <70l30i$4hd@ohnasn01.houston.omnes.net> on Wed, 21 Oct 1998 
16:46:15 GMT, PM Jenkins <pmj@hotmail.com> says...
> In article <70l16n$204@ohnasn01.houston.omnes.net>, pmj@hotmail.com (PM Jenkins) wrote:
> 
> >I suggest that people buy this book when the next
> >release comes out.  There are SO MANY typos/bugs/... in this book
> >(757 of them).  Probably you don't want to hand-fix them by marking
> >over 757 spots. Nor do you want to attach/insert 27 pages of bug listing 
> >in the book.  My guess is that after authors typed in, they never looked it
> >back until the book printed out.  Authors argue that 757 bugs are very
> >small comparing the size (less than 1 bugs / page !).  Gees what an
> >attitude !!  I think that they owe an apology to the buyers for publishing
> >such a screwed-up error-ridden version.
> >One question that I had was, how come authors ended up typing
> 
> 
> I forgot to say that
> 
> O'Reilly = lots of errors in the books, no quality control (= readers
>                end up getting low quality books - regardless of the contents
>                quality).

The authors set up a very capable system to handle feedback from a 
considerable community of reviewers.  More could not be expected of them 
(the authors, that is).

The final editing seemed rather rushed to me, but was undoubtedly 
determined by the publisher's intense desire to have the book available 
at The Perl Conference, where it rapidly sold out all the copies they 
had available.  If any apologies are necessary (which I don't think!), 
they should come from the publishers, not the authors.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 21 Oct 1998 13:18:30 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Perl DBI AND Oracle (ORACLE_HOME) (thanks)
Message-Id: <70l516$ako$1@tholian.cse.psu.edu>

In article <70hn1k$2qa$1@nnrp1.dejanews.com>,  <gavin@orbital.co.uk> wrote:
>Just wanted to say thanks for the help everyone! I still have a problem in
>that I dont have the client software for the platform I am working on so I am
>going to take a look at the ProxyServer stuff...

What type of client? Perhaps Oracle has a port for it.
John
groenveld@acm.org


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

Date: 21 Oct 1998 12:22:21 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: perl newbie trying to reference pseduoarray, better way to do this?
Message-Id: <70l1nt$etf$1@monet.op.net>

In article <362dfedd.0@news.Skantech.com>,
David Mears <davem@skantech.net> wrote:
> $tQtyRef = "L $x Qty"; $tQtyRef =~ s/\s+?//g;

Why not just

	$tQtyRef = "L" . $x . "Desc";

and forget about the s///g?  If you don't want spaces in there, don't
put them in.

You can also write this as

	$tQtyRef = "L${x}Desc";

>for ($x = 1; $x le 20; $x++)
>seams to want to drop out when it gets to past 2.. (3rd item won't print) -
>the reason why isn't obvious, 

You want <= here, not `le'.  `le' is for strings.  <= is for numbers.

	3 le 20			is false

for the same reason that

	C le BZ			is false

>though I saw an earlier message where a varable was apparently
>declared an integer and I think that will probably solve this little
>problem. 

Nope.  Not in Perl.  There are no integer variable declarations.  This
is all nonsense; please forget about it.

>in pascal or c I couldn't get away with creating a varable that is
>undeclared.  ;)

If you want Pascal or C, you know where to find them.




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

Date: 21 Oct 1998 12:45:14 -0400
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: perl newbie trying to reference pseduoarray, better way to do this?
Message-Id: <70l32q$cl5$1@pilot.njin.net>

Hello -

"David Mears" <davem@skantech.net> writes:


>I have code that goes:
>for ($x = 1; $x le 99; $x++)


You need to use the numeric comparison operators for numerical
comparisons.  This is why your 1-20 example fails (actually,
*seems* to fail - in fact it correctly does what you want, namely
to perform a string comparison).  

The one above only works by coincidence.  Change 99 to 100 and you'll
see what I mean.


>{
> $tQtyRef = "L $x Qty"; $tQtyRef =~ s/\s+?//g;
> $tDescRef = "L $x Desc"; $tDescRef =~ s/\s+?//g;
> $tPriceRef = "L $x Price"; $tPriceRef =~ s/\s+?//g;
>..
> print $FORM{$tQtyRef},"\n";
>...
>}

>which works, abet a bit ineffeciently, converting L 1 Qty to L1Qty

>is there a faster way to do this?
>print $FORM{'L' + $x + 'Desc'}  tries to print $FORM{'1'} and so forth,
>which isn't what I want.  the form that feeds this script should have an


Use the string concatenation operator.  (See perlop.)

 
>ordered list as output.  I could pass the number of items as a hidden
>varable, but that brings me to my second question..

>for ($x = 1; $x le 20; $x++)
>{
>...
>}
>seams to want to drop out when it gets to past 2.. (3rd item won't print) -


See above: 'le' is not what you want.  

You need some quantity time with perlop.


David Black
dblack@pilot.njin.net


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

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


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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 4035
**************************************

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