[12999] in Perl-Users-Digest
Perl-Users Digest, Issue: 409 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 6 20:35:15 1999
Date: Fri, 6 Aug 1999 17:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 6 Aug 1999 Volume: 9 Number: 409
Today's topics:
Re: a time to kill <tchrist@mox.perl.com>
Re: CGI.pm on NT (Doran)
Re: Complex Extract HTML (LWP does not work) (brian d foy)
Re: CRAP-7 ATTN: Article 002 - HTTP Cookie Library (Greg Bacon)
Re: CRAP-7 ATTN: Article 002 - HTTP Cookie Library <cassell@mail.cor.epa.gov>
Re: embedding multiple interpreters (specifying calls) jcistaro@my-deja.com
Re: embedding multiple interpreters (specifying calls) jim.cistaro@iatlas.com
Re: FAQ doesn't work in this case! (brian d foy)
Re: having trouble with ping command.... <biju.abraham@ebay.sun.com>
Re: having trouble with ping command.... <rootbeer@redcat.com>
Re: I guess this is a Misc question: Cgi-bin <newsgroup@bigwig.net>
Re: I guess this is a Misc question: Cgi-bin <newsgroup@bigwig.net>
Re: I guess this is a Misc question: Cgi-bin <newsgroup@bigwig.net>
Re: I guess this is a Misc question: Cgi-bin <rootbeer@redcat.com>
Re: I guess this is a Misc question: Cgi-bin <cassell@mail.cor.epa.gov>
Re: Installing PERL (Brandon Fisher)
Interpolate a hash value? (Lou Hevly)
Re: Interpolate a hash value? (Matthew Bafford)
Re: Interpolate a hash value? <rootbeer@redcat.com>
Re: Is there any books on DBI? (Larry Rosler)
Re: just days away f7.8ez5.88ox <55009@[127.0.0.1]>
Re: New to Perl - Question About RegExpr (Larry Rosler)
Re: Newbie Question Ragrding DBD::XBase On Remote Serve <mattk@cybersurf.net>
Opinions on ActiveState PerlEx ? (Matt)
Re: Perl/CGI problem: Getting Web Documents from within <makarand_kulkarni@my-deja.com>
Re: problem with DBI.pm <cassell@mail.cor.epa.gov>
Re: Problems Quoting # in qw,... <rootbeer@redcat.com>
Re: Problems Quoting # in qw,... <jeffp@crusoe.net>
Re: Reading a file into array (I got it). <allan@lovemacs.com>
Re: Sorting in a hash of hashs over two keys <cassell@mail.cor.epa.gov>
Re: Sorting in a hash of hashs over two keys ricardo_mireles@my-deja.com
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 6 Aug 1999 17:39:09 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: a time to kill
Message-Id: <37ab721d@cs.colorado.edu>
In comp.lang.perl.misc, jeromeo@atrieva.com (Jerome O'Neil) writes:
:Just out of curiosity, on average, what percent of posts to c.l.p.m get
:killed by your killfile? I think it is a good indicator of the upper
:bound on the newsgroup's DB level.
I just rewound my newsrc to 500 back, enabled the expensive header
checks, and added a kill for nospam in the header and for asp in the
subject as its own word. The results are now in.
That killfile murdered 60% of the postings, leaving us with 40% to
read. Pretty good, eh? :-)
--tom
--
"I refuse to have a battle of wits with an unarmed person."
------------------------------
Date: Fri, 06 Aug 1999 22:20:28 GMT
From: doran@NOSPAMrbj.com (Doran)
Subject: Re: CGI.pm on NT
Message-Id: <37ab5e3e.80470465@news.brandx.net>
On Fri, 06 Aug 1999 11:06:48 -0400, Steve Miles <smiles@wfubmc.edu>
wrote:
>Hi!
>
>Does anyone use the CGI.pm module on NT?
I've used it a lot and it works fine. Do your web scripts which don't
use CGI work? I assume so, but if not then the problem isn't with CGI
but with your IIS setup (are you using IIS or another server?). Also,
are you using the latest version of CGI and Perl (and the latest NT
Service Pack)? If not, that might be the cause. Otherwise I'm not sure
what it might be.
good luck
Doran...
------------------------------
Date: Fri, 06 Aug 1999 18:48:17 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Complex Extract HTML (LWP does not work)
Message-Id: <brian-ya02408000R0608991848170001@news.panix.com>
In article <7of5bq$g4a$1@nnrp1.deja.com>, inlandpac@my-deja.com posted:
> In article <brian-0508992158430001@1cust161.tnt4.durham.nc.da.uu.net>,
> brian@pm.org (brian d foy) wrote:
> > you're probably missing something in the way that you are trying to
> > use HTML::Parser. however, none of your three posts on this contain
> > a code snippet or a good description of the problem. it's hard to
> > help under those conditions.
>
> here is the code:
> use HTML::Parse;
this is old. try HTML::Parser. it's a different module. you might
want to see my or Gisle's previous posting for examples on using it,
although you should also look at the docs.
> goto LPC;
as long as you are writing sloppy code like this, don't expect
people to be very motivated to unravel it to help you.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: 6 Aug 1999 22:50:30 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: CRAP-7 ATTN: Article 002 - HTTP Cookie Library
Message-Id: <7oform$1c$1@info2.uah.edu>
In article <Pine.GSO.4.10.9908061756160.5255-100000@crusoe.crusoe.net>,
Jeff Pinyan <jeffp@crusoe.net> writes:
: BEGIN { $CRAP = "http://www.pobox.com/~japhy/perl/crap" }
Well, you are redirecting, but you should fix the broken URLs along
your redirect chain instead of forcing the server to do it for you.
Trailing slashes aren't optional when a URL addresses a directory.
Greg
--
Whoever thinks much is not suitable as a party member: he soon thinks himself
right out of the party.
-- Nietzsche
------------------------------
Date: Fri, 06 Aug 1999 16:40:52 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: CRAP-7 ATTN: Article 002 - HTTP Cookie Library
Message-Id: <37AB7284.F0C00317@mail.cor.epa.gov>
Jeff Pinyan wrote:
>
> BEGIN { $CRAP = "http://www.pobox.com/~japhy/perl/crap" }
>
> I finished it about two minutes ago, and I'd like some reviews and/or
> critiques. It can be accessed at the CRAP web site:
>
> $CRAP/002-cookielib/article.pod
> $CRAP/utils/podviewer.cgi
> (see above for expansion of $CRAP)
>
> We should have two or three more articles coming in soon!
I enjoyed it. One note: you probably want to spell 'reconstruct'
correctly in your synopsis, since you insert it in every POD file. :-)
My questions:
[1] What does Matt Wright think about this?
[2] When do you get to Selena Sol?
[3] Have you considered using an alias 2 HypE YeR KEwl SitE D00D ??
{sorry, couldn't resist after the lamers I've seen hyping *bad*
scripts}
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician
------------------------------
Date: Fri, 06 Aug 1999 22:52:18 GMT
From: jcistaro@my-deja.com
Subject: Re: embedding multiple interpreters (specifying calls)
Message-Id: <7ofouu$v2r$1@nnrp1.deja.com>
In article
<slrn7qecjt.dvk.blackman@ice4.fas.harvard.edu>,
Amos Blackman <blackman@fas.harvard.edu> wrote:
> I'm writing a shared library that basically
provides an Perl Interpreter to
> people calling into it. What I'd like to do is
have them first call into the
> library and return them a pointer to the
PerlInterpreter, they then use this
> when calling other routines in the library and
use that interpreter for
> handling the call. But my problem is that even
though I can have multiple
> interpreters in exisitence (compiling with
MULTIPLICITY), I can't specify
> which interpreter is used for evaluating
perl_call_* and perl_eval_* calls.
> Is it possible to do this? I really can't
decipher the source enough to
> figure it out, and the man pages and faqs don't
address it.
>
> Thanks!
>
> -amos
>
>
I am running into a similar situation using
multiplicity to embed perl interpreters in MySQL.
After looking at the source for perl.c it appears
that the ptr to the current interpreter is stored
in PL_curinterp. I was able to code "PL_curinterp
= (PerlInterpreter *)myInterpA;" just before any
perl_call_argv and got things to work ok. I don't
know if this is a safe/sanctioned answer, but I am
currently testing successfully.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 06 Aug 1999 23:01:39 GMT
From: jim.cistaro@iatlas.com
Subject: Re: embedding multiple interpreters (specifying calls)
Message-Id: <7ofpge$vfa$1@nnrp1.deja.com>
In article <slrn7qecjt.dvk.blackman@ice4.fas.harvard.edu>,
Amos Blackman <blackman@fas.harvard.edu> wrote:
> I'm writing a shared library that basically provides an Perl
Interpreter to
> people calling into it. What I'd like to do is have them first call
into the
> library and return them a pointer to the PerlInterpreter, they then
use this
> when calling other routines in the library and use that interpreter
for
> handling the call. But my problem is that even though I can have
multiple
> interpreters in exisitence (compiling with MULTIPLICITY), I can't
specify
> which interpreter is used for evaluating perl_call_* and perl_eval_*
calls.
> Is it possible to do this? I really can't decipher the source enough
to
> figure it out, and the man pages and faqs don't address it.
>
> Thanks!
>
> -amos
>
>
I am in a similar situation. I am using multiplicity to embed Perl
interpreters in MySQL user-defined functions. After looking at a
preprocessed perl.c , it appears that a ptr to the current interp is
tracked in PL_curinterp. I was able to code
"PL_curinterp = (PerlInterpreter *)myInterpX;" prior to calls to
perl_call_... This seemed to work fine. I do not know if this is a
safe/sanctioned answer, but I am currently testing successfully. I will
post my final test results.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 06 Aug 1999 18:49:53 -0400
From: brian@pm.org (brian d foy)
Subject: Re: FAQ doesn't work in this case!
Message-Id: <brian-ya02408000R0608991849530001@news.panix.com>
In article <7of4sp$fmp$1@nnrp1.deja.com>, inlandpac@my-deja.com posted:
> Isn't HTML::Parse or HTML::Parser supposed to do this?
>
> The documentation shows great uses, but it still does not display the
> text between the HTML tags correctly (if at all) and sometimes even
> shows attributes within tags (where these tags are complex).
HTML::Parser is fine. you must be doing something not correct.
however, you have yet to show a reasonable snippet that demonstrates
the behaviour you get. we don't need to see all of the code - just
the smallest example that illustrates the problem.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Fri, 06 Aug 1999 15:42:48 -0700
From: Biju Abraham <biju.abraham@ebay.sun.com>
Subject: Re: having trouble with ping command....
Message-Id: <37AB64E8.561631DB@ebay.sun.com>
Make sure, you are not behind a firewall !!
Biju
seong joon bae wrote:
>
> Hello,
> Can anyone tell me why the below script only works with local machines?
>
> #!/usr/local/bin/perl
>
> use Net::Ping;
> $p = Net::Ping->new();
> printf "$host is alive\n" if $p->ping($host1);
> $p->close();
>
> when i put some local machine into $host, it works.
> but if i put some other machine, say like...www.be.com, it doesn't work.
> Can anyone tell me why?
> Thank you.
------------------------------
Date: Fri, 6 Aug 1999 15:54:43 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: having trouble with ping command....
Message-Id: <Pine.GSO.4.10.9908061549040.9452-100000@user2.teleport.com>
On Fri, 6 Aug 1999, seong joon bae wrote:
> but if i put some other machine, say like...www.be.com, it doesn't work.
What do you mean by "it doesn't work"? Does it refuse to compile? Does it
refuse to run? Does it run, but it gives you the wrong output? Does it
run, but it gives you too much output? Does it run, but it gives you too
little output? Does it march up and down outside the building carrying a
protest sign and chanting "seong joon bae is unfair to programs"? Saying
"it doesn't work" is a little vague.
But my guess is that you should (re)read the docs for Net::Ping,
especially the notes. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 6 Aug 1999 22:45:55 +0100
From: "Ben Quick" <newsgroup@bigwig.net>
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <37ab6d5a.0@news2.cluster1.telinco.net>
>> > Could anyone remind me of what my cgi-bin should be chmoded to.
>>
>> Remind? _Remind_? You claiming to have previously known this, yet now
>> you can neither work it out for yourself nor discover which usenet group
>> to post to?
>
>Uh-oh, look at his name. Don't get him mad, or he might burn your
>barn down one night. :-)
WHAT??????
>David, posting from Yoknapatawpa County
>--
>David Cassell, OAO
>cassell@mail.cor.epa.gov
>Senior Computing Specialist
>mathematical statistician
------------------------------
Date: Fri, 6 Aug 1999 23:05:46 +0100
From: "Ben Quick" <newsgroup@bigwig.net>
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <37ab6d66.0@news2.cluster1.telinco.net>
>> Could anyone remind me of what my cgi-bin should be chmoded to.
>
>Remind? _Remind_?
Yes, no need to repeat whatI've already said
>You claiming to have previously known this,
Not claiming anything. I read it somewhere and forgot what it was
>yet now
>you can neither work it out for yourself
Which is surely why I posted
>nor discover which usenet group
>to post to?
Well I'm sorry for being off topic. But to be fair, everyone (if not most)
here should know what the answer to my question is. It's only 3 numbers that
you needed to post
>This seems to be a question about configuration for a web server under a
>certain OS, namely unix.
Yes, that is true. But I am using w98 and can emulate the chmod command for
my unix server
>There is a usenet group comp.infosystems.www.servers.unix
>which is about web servers running under unix.
Thanks for the somwhat long winded pointer
>You might also want to review the FAQ about how to compose a meaningful
>subject header.
Which I thought I did "I guess this is a Misc question" hence the misc in
the ng name and "Cgi-bin" eg this post is something to do with the cgi-bin.
Sorry if you couldn't understand my cryptic clues
>Assuming, of course, that you were hoping to
>communicate with helpful usenauts.
I was, yes. But so far (in this group) haven't
>> I have had
>> to create my own, therefore I have to chmod it. 755 seems to be the norm,
>> but is it different for the bin?
>
>OT answer: I don't see why it should be different, unless you have some
>specific requirement that you haven't mentioned (but not here, please).
>It's what I use.
THANKYOU! You took all day to reach the answer. But at last
------------------------------
Date: Fri, 6 Aug 1999 22:53:34 +0100
From: "Ben Quick" <newsgroup@bigwig.net>
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <37ab6d5f.0@news2.cluster1.telinco.net>
Bloody hell. Calm down everyboody. I want to put perl scripts in a cgi-bin.
I want to know what the cgi-bin should be set to. A simple answer was
required (eg 3 numbers), not flames. I'm off, you lot are far too serious.
I'm sorry I didn't realise that you lot can't stand a question that doen't
contain the word perl in it. I, possibly wrongly (because cgi can be written
in other lanbguages etc) associate perl with cgi, that is why the question
was asked here.
I'd like to thank Anno and Matthew for the responses given though. They were
polite and didn't in any way shape or form put me down.
I'd like to thank Bart for answering the question and getting to the point
without attempting to flame me or put me down for asking a question
Lighten up
On the whole most of the posters in this group come across as regarding
themselves as better than everybody else and therefore above everyboody
else. Well I'm sure I'm sorry for just starting out in perl and asking a
question
Ben Quick (AGGTA B.O.D) wrote in message
<37aaf0ac.0@news2.cluster1.telinco.net>...
>Could anyone remind me of what my cgi-bin should be chmoded to. I have had
>to create my own, therefore I have to chmod it. 755 seems to be the norm,
>but is it different for the bin?
>
>Cheers
>BQ
>--
>----
>http://come.to/noname.net
>http://drive.to/bq
>ICQ 37863699
>----
------------------------------
Date: Fri, 6 Aug 1999 15:59:39 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <Pine.GSO.4.10.9908061556050.9452-100000@user2.teleport.com>
On Fri, 6 Aug 1999, Ben Quick wrote:
> Well I'm sorry for being off topic. But to be fair, everyone (if not
> most) here should know what the answer to my question is.
By that logic, you could justify asking random strangers in a supermarket
if you wanted to learn where to go to get treatment for syphilis. Please,
ask only on-topic questions in newsgroups. Thank you.
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 06 Aug 1999 16:24:31 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <37AB6EAF.C3B09DEE@mail.cor.epa.gov>
Ben Quick wrote:
[snip down to my wry comment]
> >Uh-oh, look at his name. Don't get him mad, or he might burn your
> >barn down one night. :-)
>
> WHAT??????
>
> >David, posting from Yoknapatawpa County
Sorry, I didn't think a William Faulkner reference would be that
obscure. Especially one with a Paul Newman movie attached...
BTW Ben, Paul Newman played the guy with *your* name.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician
------------------------------
Date: 06 Aug 1999 22:17:43 GMT
From: bf4kh@aol.comnospam (Brandon Fisher)
Subject: Re: Installing PERL
Message-Id: <19990806181743.01446.00008001@ng-cq1.aol.com>
Thanks a lot!
Brandon Fisher
http://members.aol.com/BF4KH/index.htm
------------------------------
Date: Fri, 06 Aug 1999 22:19:16 GMT
From: lou@visca.com (Lou Hevly)
Subject: Interpolate a hash value?
Message-Id: <37ab5f4d.4952928@spamkiller.newsfeeds.com>
Greetings:
I'm writing a CGI script in Perl and I want the script to be useable
in at least 3 languages. Therefore I've created a text file called
english.txt (there will be corresponding catalan.txt, spanish.txt,
etc. files) that's like this:
no_pwd|Uh-oh! You forgot to fill in a password! Use your browser's
back button to return to the previous page.
wrong_pwd|Sorry, Charlie! <b>$passwd</b> [I know; doesn't work] isn't
the correct password. Use your browser's back button to return to the
previous page.
title1|Success!
etc.
Then I load this file into a hash at the beginning of my program and
whenever the program prints anything, I code it thus:
unless ($passwd) {
error($lang_hash{no_pwd});
exit;
}
unless ($passwd eq 'qahs67') {
error($lang_hash{wrong_pwd});
exit;
}
So if I want my script to run in Spanish or French or whatever, I need
only load a different language text file.
However, in the $lh{wrong_pwd} case, I would like the "<b>$passwd</b>"
to interpolate, so that the user could see the incorrect password he
or she has entered. I'm pretty sure this just can't be done, but since
my Perl level isn't very high, I thought I'd ask. I am also posting in
the hope that someone might suggest a way to accomplish what I'm
trying to do.
Many thanks.
--
Lou Hevly (JAPHW)
lou@visca.com
http://www.visca.com
------------------------------
Date: Fri, 06 Aug 1999 22:38:54 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Interpolate a hash value?
Message-Id: <slrn7qmoel.ugv.*@dragons.duesouth.net>
Fri, 06 Aug 1999 22:19:16 GMT, a great smashing of the head occured
against Lou Hevly)'s keyboard, causing comp.lang.perl.misc to receive
this:
: However, in the $lh{wrong_pwd} case, I would like the "<b>$passwd</b>"
: to interpolate,
perlfaq4.pod:=head2 How can I expand variables in text strings?
: Many thanks.
HTH,
--Matthew
------------------------------
Date: Fri, 6 Aug 1999 16:02:43 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Interpolate a hash value?
Message-Id: <Pine.GSO.4.10.9908061600450.9452-100000@user2.teleport.com>
On Fri, 6 Aug 1999, Lou Hevly wrote:
> However, in the $lh{wrong_pwd} case, I would like the "<b>$passwd</b>"
> to interpolate,
The FAQ talks about this in section four: "How can I expand variables in
text strings?". Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 6 Aug 1999 16:38:07 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Is there any books on DBI?
Message-Id: <MPG.121511b848334a17989df3@nntp.hpl.hp.com>
In article <37AAA79C.C6E48946@kawo2.rwth-aachen.de> on Fri, 06 Aug 1999
11:15:08 +0200, Alex Farber <alex@kawo2.rwth-aachen.de> says...
> "John C." wrote:
> > Hi, I am new to perl and am wondering if there are any books on DBI or
> > information available on the web.
> > I would like to use the mSQL DBD.
>
> a book "MySQL & mSQL" http://www.oreilly.com/catalog/msql/
> has just been published by O'Reilly
But is not yet available. Amazon is selling it at 40% off or so, but
doesn't have any.
I printed the online chapter at
<URL:http://www.oreilly.com/catalog/msql/chapter/ch10-beta.html> and was
unimpressed, because the examples have far too much HTML and CGI stuff
(and boring at that) and not enough DBI stuff. I hope the rest of the
book corrects the focus.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 6 Aug 1999 23:18:00 +0100
From: Jack & Megan <55009@[127.0.0.1]>
Subject: Re: just days away f7.8ez5.88ox
Message-Id: <PXWnnTAY81q3EwkJ@stormshadow.co.uk>
<spamtrapped - domain is stormshadow (dot) co (dot) uk>
In article <199908060843.DAA06280@reject.kewlhair.com>, reject
<The@reject.kewlhair.com> writes
>This is your last warning! Read CAREFULLY and be edified:
<psudeo-Christian preaching rant deleted>
"The world won't end in darkness, it will end in family fun,
with Coca-Cola clouds and a Big Mac sun"...
(from "Only One God?" by "The Beautiful South").
The world may indeed be on the edge of disaster, but it has nothing
to do with the Solar Eclipse, the Millennium, or your religion - it might
have a great deal to do with the western obsession with private
transport though...
Blessed be!
:-)
--
Jack & Megan
"Runnaway train, never coming back, wrong way down a one way track..."
http://www.stormshadow.co.uk
------------------------------
Date: Fri, 6 Aug 1999 16:53:48 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: New to Perl - Question About RegExpr
Message-Id: <MPG.12151568f9dc7422989df4@nntp.hpl.hp.com>
In article <37AB29F9.36084384@mail.cor.epa.gov> on Fri, 06 Aug 1999
11:31:21 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
> Derek Battams wrote:
> >
> > I've just started to write CGIs in Perl (I've been writing them in C) and
> > I've come across the following line in a script that someone else has
> > written:
> >
> > $Config{'required'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g;
>
> The question you forgot to ask is: "Is this regex any good?"
> I doubt it. The author didn't seem to know that the character class
> \s includes the newline \n already, so this regex seems to do a lot
> more work than is needed.
$Config{required} =~ s/\s*,\s*/,/g;
Judging from the FAQ on trimming leading and trailing spaces, it might
even be better (faster) this way:
$Config{required} =~ s/\s+,/,/g;
$Config{required} =~ s/,\s+/,/g;
But I digress...
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 06 Aug 1999 16:00:49 -0700
From: Matt Kennedy <mattk@cybersurf.net>
Subject: Re: Newbie Question Ragrding DBD::XBase On Remote Server
Message-Id: <37AB6921.50E45306@cybersurf.net>
"Mr. Baseball" wrote:
>
> I am just getting into the wide world of DBI and DBD in Perl. I have
> been reading the FAQs and surfing the Net and still come up short
> regarding one question: What is necessary to access a remote database
> using the DBI and DBD modules on a WinNT server? All the code examles
> I have seen only poll a local database with their queries.
my $dbh =
DBI->connect('DBI:driver:dbname:hostname','username','password');
Replace hostname with whatever is appropriate.
Matt
------------------------------
Date: Fri, 06 Aug 1999 23:13:08 GMT
From: mck@iag.net (Matt)
Subject: Opinions on ActiveState PerlEx ?
Message-Id: <37ae6a79.33056272@news.iag.net>
For some intranet needs I am considering using ActiveState Perl on one
of our NT boxes. With this one language, it would appear that I can
embed PerlScript in ASP for dynamic pages, and use external routines
through CGI for other functionality.
I like the 'one language fits all' concept for this project, as I need
to keep it simple and clean. However, a simple test, using an ASP page
to return 300 records into an HTML table is showing PerlScript running
about 1/3 the speed of VBScript. This type of performance is not the
primary concern, but I will take speed where I can get it.
ActiveState's site claims their PerlEx will speed things up
dramatically. Can anyone confirm or deny this through experience? Any
good or bad experiences?
------------------------------
Date: Fri, 06 Aug 1999 23:06:15 GMT
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
Subject: Re: Perl/CGI problem: Getting Web Documents from within my CGI!
Message-Id: <7ofpp1$vhv$1@nnrp1.deja.com>
[In article <FG0Mq4.67K@campus-news-reading.utoronto.ca>,
"Michael R. Seringhaus" <m.seringhaus@utoronto.ca> wrote:]
>What I want to do seems easy in principle. I want to have
>my perl script take user input and query a series of web pages,
>then grab all the HTML that these HTTP requests generated,
>parse it, pick out the useful bits and .. {rest snipped}
--
There is a wealth of information in perldoc LWP::UserAgent.
You can create user agent objects
$ua = new LWP::UserAgent;
and HTTP request(s)
$request = new HTTP::Request('GET', 'http://whatever//');
and recieve responses from the various servers using a variant
of the request() call that allows a callback function as
an argument to do your filtering ( before slamming into email..)
$response = $ua->request($request, \&callback, ...);
--
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 06 Aug 1999 16:22:24 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: problem with DBI.pm
Message-Id: <37AB6E30.4A57543E@mail.cor.epa.gov>
mao wrote:
>
> i've a problem with DBI.pm:
>
> i downloaded ActivePerl 518 (as i use Win95), the latest version of
> DBI.pm (113) and copied it into the perl/lib directory.
> then i got the mysql.pm from mysql.org.
> i also downloaded some perl scripts that use DBI.pm to contact a mysql
> db.
>
> i tried to run them, but everytime i got the errmsg "can't locate
> loadable object in @NIC...".
[snip]
You didn't install DBI.pm, you just snagged a copy and stuck it
somewhere.
Use ppm to install it for you. At a command prompt, type:
ppm install DBI
and let Perl put the module where it is supposed to go.
> PLEASE MAIL ME!
That's not very polite in Usenet.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician
------------------------------
Date: Fri, 6 Aug 1999 15:33:38 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Problems Quoting # in qw,...
Message-Id: <Pine.GSO.4.10.9908061530260.9452-100000@user2.teleport.com>
On Fri, 6 Aug 1999, Xeno Campanoli wrote:
> I'm trying to put a list of words in an array as elegantly as possible.
So, the problem isn't how to do it, it's how to make it elegant. Remove
the two characters '-w' from the first line. What, that's not your
definition of elegant? :-)
Well, this patch following my .sig is more quick-and-dirty than elegant,
but maybe it'll suit your needs. Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
--- toke.c.orig Fri Aug 6 15:01:18 1999
+++ toke.c Fri Aug 6 15:03:57 1999
@@ -3689,19 +3689,6 @@
s = scan_str(s);
if (!s)
missingterm((char*)0);
- if (PL_dowarn && SvLEN(PL_lex_stuff)) {
- d = SvPV_force(PL_lex_stuff, len);
- for (; len; --len, ++d) {
- if (*d == ',') {
- warn("Possible attempt to separate words with commas");
- break;
- }
- if (*d == '#') {
- warn("Possible attempt to put comments in qw() list");
- break;
- }
- }
- }
force_next(')');
PL_nextval[PL_nexttoke].opval = (OP*)newSVOP(OP_CONST, 0, tokeq(PL_lex_stuff));
PL_lex_stuff = Nullsv;
------------------------------
Date: Fri, 6 Aug 1999 18:09:15 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Problems Quoting # in qw,...
Message-Id: <Pine.GSO.4.10.9908061805500.5255-100000@crusoe.crusoe.net>
[posted & mailed]
On Aug 6, Xeno Campanoli blah blah blah:
> I'm trying to put a list of words in an array as elegantly as possible.
> One of the words, however, is the sharp or pound sign character (#). I
> lastly posted the following:
While
qw()
does *IN ESSENCE* the same as
split ' ', q()
the warning you received is not raised when using the latter.
This works for me:
% perl -w
@x = split ' ', << 'END';
a b # % $ @#@ %$
END
print "@x\n";
__END__
a b # % $ @#@ %$
This can also be done without the here-doc. Do something like:
@x = split ' ', q{ ! @ # $ % ^ & * ( ) _ + };
These don't produce any error for me.
--
jeff pinyan japhy@pobox.com
japhy's little hole in the (fire) wall: http://www.pobox.com/~japhy
perl stuff japhy+perl@pobox.com
japhy's perl supposit^Wrepository: http://www.pobox.com/~japhy/perl
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN
------------------------------
Date: Fri, 06 Aug 1999 15:58:27 -0700
From: Allan Schwartz <allan@lovemacs.com>
Subject: Re: Reading a file into array (I got it).
Message-Id: <37AB6893.7BE5E62A@lovemacs.com>
...
> > I am having trouble reading a file of CSV email addresses into an array.
>
> Have you seen section four of the FAQ? Look for "comma-separated".
I must say that the FAQ is very successfull, in my case. I read
the FAQ, and then wrote a script to which reads my QuickBooks
Items list (already "excel"ized into a CSV), reads all items
into a associative array.
Then the script reads a skeleton of an HTML page, and emits
a full product/price list for all the items called out
in the skeleton page -- complete with order buttons, for the
items which can be ordered at our Yahoo mini-eStore, and pictures,
if a jpg exists, and shipping weight (if denoted in the QuickBooks
database).
I just wanted to say that the FAQ is great!
-allan allan@lovemacs.com www.lovemacs.com
------------------------------
Date: Fri, 06 Aug 1999 16:34:38 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Sorting in a hash of hashs over two keys
Message-Id: <37AB710E.6F0F017F@mail.cor.epa.gov>
ricardo_mireles@my-deja.com wrote:
[snip]
> I read
> "perldsc". Can you please hint where I can find more about creating a list of
> records sorted across two "fields" in a Hash of Hashes.
Good. That's an important step.
> Ex: sort by lastname
> then by firstname in :
>
> %HoH = (
[HoH snipped]
Okay, now read the FAQ question about sorting. If that doesn't explain
enough, it also points you toward a URL which has Tom Christiansen's
FMTEYEWTK tome on sorting.
HTH,
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician
------------------------------
Date: Fri, 06 Aug 1999 23:46:38 GMT
From: ricardo_mireles@my-deja.com
Subject: Re: Sorting in a hash of hashs over two keys
Message-Id: <7ofs4r$1dl$1@nnrp1.deja.com>
NO -- sorry for the mess Take 2: I want to sort across two "fields" in a
Hash (all records with record number as key) of Hashes (each record with
fieldnames as key) Ex: sort by lastname then by firstname. -- I read
"perldsc," but it only decribes sorting on one field.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 409
*************************************