[13984] in Perl-Users-Digest
Perl-Users Digest, Issue: 1394 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 16 12:10:43 1999
Date: Tue, 16 Nov 1999 09:05:20 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942771920-v9-i1394@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 16 Nov 1999 Volume: 9 Number: 1394
Today's topics:
Re: /o in regexp with mod_perl <moseley@best.com>
Adding to @INC during perl install <tpost@intelihealth.com>
Re: Adding to @INC during perl install <jxu@wcom.net>
Re: Can open file with Telnet but not browser <amonotod@netscape.net>
Re: Can open file with Telnet but not browser <gellyfish@gellyfish.com>
Charset Conversion. <jdijkmei@dds.nl>
Re: Charset Conversion. <sb@sdm.de>
Re: CHMOD for Net::FTP. Help, cool hackers ! <microwizard@my-deja.com>
Re: Debugging from CGI plarson@cheerful.com
Fetch Dilbert. (Abigail)
Re: Fetch Dilbert. <uri@sysarch.com>
Re: Fetch Dilbert. <linberg@literacy.upenn.edu>
Re: Fetch Dilbert. (Randal L. Schwartz)
Re: Fetch Dilbert. <revjack@radix.net>
Re: Fetch Dilbert. arvind@mail.ece.umn.edu
Re: Fetch Dilbert. <rhomberg@ife.ee.ethz.ch>
Re: Generating pi (Abigail)
Re: getting started with MySQL and Perl (Randal L. Schwartz)
Re: Hebrew HTML Clever Converter <gellyfish@gellyfish.com>
Re: Help with Win32::Service michaelh@erols.com
How do I produce a random number? (Lab. - konto &)
Re: How do I produce a random number? (Simon Cozens)
Re: How do I produce a random number? <rhomberg@ife.ee.ethz.ch>
Re: how to create a random id? <bene@chiark.greenend.org.uk>
Re: Java faster than perl ?!?!? (Kragen Sitaker)
Re: Java faster than perl ?!?!? (Kragen Sitaker)
Re: Longest match (Eric Bohlman)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 16 Nov 1999 07:32:11 -0800
From: Bill Moseley <moseley@best.com>
Subject: Re: /o in regexp with mod_perl
Message-Id: <MPG.129b18d3e568570b98987f@nntp1.ba.best.com>
lee.lindley@bigfoot.com (lee.lindley@bigfoot.com) seems to say...
> Bill Moseley <moseley@best.com> wrote:
> :>Each 'request' to my CGI script I build one or more regular expressions
> :>using qr{} that are used over and over during that request in m// and
> :>s///.
>
> :> $match{ $field } = qr/^($terms)/;
>
> Assuming that %match is not a file scoped lexical (which are
> problematic for mod_perl) and/or you are clearing out %match at the
> beginning of each execution, then this should work just fine. The
> regexp is recompiled only during the assignment. You don't need /o.
I see that placing /o there is wrong. But placing it where I should
place it doesn't work under mod_perl -- so back to my original problem.
Yes, $match happens to be a file scoped lexical. But it's a file scoped
lexical in a _module_ so I don't have a closure issue in mod_perl.
At the start of every request I set %match = ();
Again, if someone searches:
~title=(perl python)
~subject=(programming)
~description=(regular expressions)
I get
$match{title} = qr/^(perl|python)/;
$match{subject} = qr/^(programming)/;
$match{description} = qr/^(regular|expressions)/;
Now, while printing record after record I want to highlight words in
each record. I break the record into title, subject, and description,
and I call this sub:
highlight_text( $title_text, $match{title} );
sub highlight_text {
my ( $text, $match_regex ) = @_;
my @words_to_highlight;
foreach ( split_text_into_words( $text ) {
push @words_to_highlight, $_
if /$match_regex/; # /o would be good here.
}
Normally, I would put /o in that loop, and it works fine under mod_cgi,
but if I do use /o under mod_perl it continues to highlight the words
used in the very first search request to Apache.
Can I pass _compiled_ regular expressions? Note that $match_regex is
one of the $match{$field} expressions. Since it is used over and over I
thought placing the /o when that expression is first created would work
-- I'd then be passing a compiled regular expression to
hightlight_text(). But I guess it doesn't work that way.
The only solution I can see is wrap my foreach loop in an eval "" block
to force recompile and use /o, but then I'm doing an eval fore each
record in my result. I didn't test, but I guessed that the eval would
offset the efficiency of the /o.
Thanks for all your time.
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Tue, 16 Nov 1999 10:30:24 -0500
From: Tony Demark <tpost@intelihealth.com>
Subject: Adding to @INC during perl install
Message-Id: <3831788D.DD364C50@intelihealth.com>
This would seem to be an easy question, but I just can't find the answer
in the FAQ or INSTALL file:
When installing perl (5.005_03), how do I add additional directories to
@INC?
Right now, there are five entries in my @INC:
* Where perl standard components go:
- /opt/local/lib/perl5/5.00503/sun4-solaris
- /opt/local/lib/perl5/5.00503
* Where additional components go:
- /opt/local/lib/perl5/site_perl/5.005/sun4-solaris
- /opt/local/lib/perl5/site_perl/5.005
* and
- .
I am looking to provide a location where locally developed modules can
go (separate from the site_perl dirs), "/opt/local/PM", eg.
How can I do this when Config'ing perl?
Thanks,
- Tony
------------------------------
Date: Tue, 16 Nov 1999 11:34:13 -0500
From: "Jun Xu" <jxu@wcom.net>
Subject: Re: Adding to @INC during perl install
Message-Id: <80s15d$mun$1@news.cis.ohio-state.edu>
The content of @INC is compiled into the perl executable. To alter it, I
would think you need to change either the source code or some configuration
file and recompile it.
Tony Demark <tpost@intelihealth.com> wrote in message
news:3831788D.DD364C50@intelihealth.com...
> This would seem to be an easy question, but I just can't find the answer
> in the FAQ or INSTALL file:
>
> When installing perl (5.005_03), how do I add additional directories to
> @INC?
> Right now, there are five entries in my @INC:
>
> * Where perl standard components go:
> - /opt/local/lib/perl5/5.00503/sun4-solaris
> - /opt/local/lib/perl5/5.00503
>
> * Where additional components go:
> - /opt/local/lib/perl5/site_perl/5.005/sun4-solaris
> - /opt/local/lib/perl5/site_perl/5.005
>
> * and
> - .
>
> I am looking to provide a location where locally developed modules can
> go (separate from the site_perl dirs), "/opt/local/PM", eg.
>
> How can I do this when Config'ing perl?
>
> Thanks,
> - Tony
>
>
------------------------------
Date: Tue, 16 Nov 1999 16:14:22 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Can open file with Telnet but not browser
Message-Id: <80rvso$52u$1@nnrp1.deja.com>
In article <38309E1A.7564EE23@mail.cor.epa.gov>,
David Cassell <cassell@mail.cor.epa.gov> wrote:
> > do a quick test, some MS machines use c:\perl\bin\ as the working
> > directory, so you may need to set your directory... This doesn't
> > usually affect Unix machines, but you never know...
>
> I don't know of any webservers which use this directory as
> the working directory.
Ahh, whatever, just run the script...
>
> > #!perl
>
> This doesn't work for some servers, like earlier versions of
> Apache. Besides, there's no -w flag and no 'use strict' pragma.
>
> > use Cwd;
> >
> > my $dir=Cwd::cwd;
> > print "Content-type: text/html\n\n";
> > print "The current dir is $dir\n";
> > exit;
>
> This is HTML?
No David, it is a _simple_ test, to see if the server works. You don't
need every switch turned on to run a test script. Nor do we need to
worry about whether or not our return is printed in proper html. Just
save the script into your cgi-bin directory and see what you get. If it
doesn't work as advertised, I will make sure that from now on, when I
post, I notify you at your personal email so that you may critique what
I say. Even better, I will send my reply to you first, and if you
approve, you can post it for me! Work for you?
Have a nice day!
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Nov 1999 16:34:19 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Can open file with Telnet but not browser
Message-Id: <3831878b_1@newsread3.dircon.co.uk>
amonotod <amonotod@netscape.net> wrote:
>
> No David, it is a _simple_ test, to see if the server works. You don't
> need every switch turned on to run a test script. Nor do we need to
> worry about whether or not our return is printed in proper html. Just
> save the script into your cgi-bin directory and see what you get. If it
> doesn't work as advertised, I will make sure that from now on, when I
> post, I notify you at your personal email so that you may critique what
> I say. Even better, I will send my reply to you first, and if you
> approve, you can post it for me! Work for you?
>
Got a bit of a problem with public disapproval it seems ... Oh and if you
are going to post from deja news can you cut six lines from your signature.
/J\
--
"The internet is like a car boot sale" - Jon Sopel, BBC News
------------------------------
Date: Tue, 16 Nov 1999 15:22:08 +0100
From: "jeroen dijkmeijer" <jdijkmei@dds.nl>
Subject: Charset Conversion.
Message-Id: <80roin$sja$1@news.worldonline.nl>
G'day all,
We are trying to import a huge file into a sybase database but at this
moment we're struggling with charset issues. Sybase will accept an iso
8859-1 charset, but that is not the charset we have in our import file, this
is cp 850, My question: is there an easy way to convert from cp 850 to iso
8859-1.
Thnx in Advance.
------------------------------
Date: 16 Nov 1999 14:47:21 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Charset Conversion.
Message-Id: <80rqpp$3ij$1@solti3.sdm.de>
[Posted && mailed]
In article <80roin$sja$1@news.worldonline.nl>,
jeroen dijkmeijer <jdijkmei@dds.nl> wrote:
> We are trying to import a huge file into a sybase database but at this
> moment we're struggling with charset issues. Sybase will accept an iso
> 8859-1 charset, but that is not the charset we have in our import file, this
> is cp 850, My question: is there an easy way to convert from cp 850 to iso
> 8859-1.
> Thnx in Advance.
See the pc2iso filter on my web site (see URL in my sig below).
HTH.
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/ (Who am I)
http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)
------------------------------
Date: Tue, 16 Nov 1999 15:24:08 GMT
From: MetaWizard <microwizard@my-deja.com>
Subject: Re: CHMOD for Net::FTP. Help, cool hackers !
Message-Id: <80rsui$2jv$1@nnrp1.deja.com>
In article <Pine.HPP.3.95a.991113175855.21249C-100000@hpplus01.cern.ch>,
"Alan J. Flavell" <flavell@mail.cern.ch> wrote:
> On Sat, 13 Nov 1999, MetaWizard wrote:
>
> > entrance to your account only via FTP. To change mode of files in my
> > directories I am writing "chmod 0666 test.txt"(for examle).
> > So I need realization of this method to make this procedure from
Perl-
> > script. But Net::FTP doesn't enable it.
>
> I haven't tried it, but I would suggest you probably need to use
> Net::FTP's 'quot' to send a 'SITE CHMOD' command to the remote server.
>
> Try it by hand from an FTP client first. When I try it on my host:
>
> ftp> quot help site chmod
> 214 Syntax: SITE CHMOD <sp> mode <sp> file-name
>
> ftp> quot site chmod 755 foobar
> 200 CHMOD command successful.
>
> Then you could try the same thing via the module.
>
> good luck (wouldn't this question have been more on-topic on the
> c.l.p.modules group? Oh, and I read this posting by accident: if I had
> spotted "cool hackers" in the subject line first, I would have plonked
> it unread).
>
Thank to everybody for your help!
One more problem I found. I can't chmod by mask. I have about 8
directories, suumary with about 400 files and I have to change their
mode. For each directory there is a constant mode for files in this
directory. How can I quickly chmod all this files ?
Please give one more advice!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 16 Nov 1999 16:41:56 GMT
From: plarson@cheerful.com
Subject: Re: Debugging from CGI
Message-Id: <80s1gk$6fo$1@nnrp1.deja.com>
Can you please tell us in detail how you got it to work? It may have
worked at the TPC, but in reality, I have not seen it work on my end,
and I have been struggling with this for a month on and off. I have
tried all options that are given on the ptkdb perldoc and website.
Thanks for any input...
Patrick
> The GUI debugger (ptkdb?) featured in the last issue of the Perl
Journal
> can deal with CGI scripts and the browser just fine. I saw a demo of
it
> at TPC, and tried it out myself.
>
> The command-line debugger ("perl -d") isn't so bad either, and you can
> type your parameters when prompted and run it like any other script.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Nov 1999 06:27:13 -0600
From: abigail@delanet.com (Abigail)
Subject: Fetch Dilbert.
Message-Id: <slrn832jjg.cvu.abigail@alexandra.delanet.com>
Here's a little script that fetches the daily Dilbert image, and
displays it in a viewer. You might want to change the '$viewer'
line if you wish to use this program.
Abigail
#!/opt/perl/bin/perl -w
#
# $Id: dilbert.pl,v 1.1 1999/11/16 12:25:51 abigail Exp abigail $
#
# $Log: dilbert.pl,v $
# Revision 1.1 1999/11/16 12:25:51 abigail
# Initial revision
#
#
use strict;
use LWP::Simple;
my $dilbert_url = 'http://www.dilbert.com';
my $comic_url = '(/comics/dilbert/archive/images/dilbert\d+.gif)';
my $viewer = '/usr/local/bin/display -';
my $dilbert = get $dilbert_url or die "Failed to fetch dilbert.\n";
my ($comic) = $dilbert =~ /$comic_url/ or die "Failed to find comic.\n";
my $image = get "$dilbert_url$comic" or die "Failed to fetch comic.\n";
open DISPLAY, "| $viewer" or die "Failed to open viewer.\n";
print DISPLAY $image;
close DISPLAY or die "Failed to close viewer.\n";
__END__
=pod
This program is copyright 1999 by Abigail.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=cut
--
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 16 Nov 1999 09:26:53 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Fetch Dilbert.
Message-Id: <x7vh72tsuq.fsf@home.sysarch.com>
>>>>> "A" == Abigail <abigail@delanet.com> writes:
A> Here's a little script that fetches the daily Dilbert image, and
A> displays it in a viewer. You might want to change the '$viewer'
A> line if you wish to use this program.
i wrote something recently to get a month of calvin & hobbes (and
another strip or too). i got sick of the ads and the pain of fetching
one at a time. i may post the raw code sometime.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 16 Nov 1999 10:31:15 -0500
From: Steve Linberg <linberg@literacy.upenn.edu>
Subject: Re: Fetch Dilbert.
Message-Id: <m3ogcu8ncs.fsf@projdirc.literacy.upenn.edu>
Uri Guttman <uri@sysarch.com> writes:
> i wrote something recently to get a month of calvin & hobbes (and
> another strip or too). i got sick of the ads and the pain of fetching
> one at a time. i may post the raw code sometime.
Please do!
--
Steve Linberg, Chief Goblin
Silicon Goblin Technologies
http://silicongoblin.com
Be kind. Remember, everyone you meet is fighting a hard battle.
------------------------------
Date: 16 Nov 1999 07:39:36 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Fetch Dilbert.
Message-Id: <m1hfim5ttz.fsf@halfdome.holdit.com>
>>>>> "Uri" == Uri Guttman <uri@sysarch.com> writes:
>>>>> "A" == Abigail <abigail@delanet.com> writes:
A> Here's a little script that fetches the daily Dilbert image, and
A> displays it in a viewer. You might want to change the '$viewer'
A> line if you wish to use this program.
Uri> i wrote something recently to get a month of calvin & hobbes (and
Uri> another strip or too). i got sick of the ads and the pain of fetching
Uri> one at a time. i may post the raw code sometime.
Or you can just look at my WebTechniques column # 15, at
http://www.stonehenge.com/merlyn/WebTechniques/col15.html
Hmm. Common theme here. :)
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 16 Nov 1999 15:49:13 GMT
From: revjack <revjack@radix.net>
Subject: Re: Fetch Dilbert.
Message-Id: <80rudp$fga$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
Uri Guttman explains it all:
:>>>>> "A" == Abigail <abigail@delanet.com> writes:
: A> Here's a little script that fetches the daily Dilbert image, and
: A> displays it in a viewer. You might want to change the '$viewer'
: A> line if you wish to use this program.
:i wrote something recently to get a month of calvin & hobbes (and
:another strip or too). i got sick of the ads and the pain of fetching
:one at a time. i may post the raw code sometime.
I have a daily cron job that pulls in all 96 comics from the
unitedmedia.com website and places them on my hard drive,
with an HTML index page that contains IMG tags to each one
and, best of all, the proper height and width elements for
each IMG tag. I'd be happy to e-mail the source on request
but I won't post it here.
--
hey/don't look now/but there goes god/in sexy pants/with a sausage
dog/and he can't stand beelzebub/coz he looks so good in black
revjack@radix.net
------------------------------
Date: 16 Nov 1999 16:04:42 GMT
From: arvind@mail.ece.umn.edu
Subject: Re: Fetch Dilbert.
Message-Id: <80rvaq$1lg$1@news1.tc.umn.edu>
In <x7vh72tsuq.fsf@home.sysarch.com>, Uri Guttman <uri@sysarch.com> wrote:
> another strip or too). i got sick of the ads and the pain of fetching
> one at a time. i may post the raw code sometime.
> uri
since nobody's posted this yet try out www.junkbusters.com . They have a
client that sits between your favourite browser and your net connection,
and removes all ads (the definition of which is up to you).
-Arvind
--
\perl -e '$n=reverse pack("C*",117,100,101,46,110,109,117,46,101,\
99,101,46,108,105,97,109,64,100,110,105,118,114,97,32,32,32,32,\
32,32,32,32,32,32,114,97,107,105,100,110,97,114,97,75,32,46,75,\
32,100,110,105,118,114,65);print "\n$n\n\n"'
------------------------------
Date: Tue, 16 Nov 1999 17:11:51 +0100
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Fetch Dilbert.
Message-Id: <38318247.90CD9DF6@ife.ee.ethz.ch>
revjack wrote:
>
> Uri Guttman explains it all:
> :>>>>> "A" == Abigail <abigail@delanet.com> writes:
>
> : A> Here's a little script that fetches the daily Dilbert image, and
> : A> displays it in a viewer. You might want to change the '$viewer'
> : A> line if you wish to use this program.
>
> :i wrote something recently to get a month of calvin & hobbes (and
> :another strip or too). i got sick of the ads and the pain of fetching
> :one at a time. i may post the raw code sometime.
>
> I have a daily cron job that pulls in all 96 comics from the
> unitedmedia.com website and places them on my hard drive,
> with an HTML index page that contains IMG tags to each one
> and, best of all, the proper height and width elements for
> each IMG tag. I'd be happy to e-mail the source on request
> but I won't post it here.
I have a daily cron job that pulls out all missing dilberts from the
archive and sends a mail with them to me. But I won't show the code to
anyone, as it is from the days before c.l.p.m :-)
- Alex
------------------------------
Date: 16 Nov 1999 06:32:11 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Generating pi
Message-Id: <slrn832jsq.cvu.abigail@alexandra.delanet.com>
Ilya Zakharevich (ilya@math.ohio-state.edu) wrote on MMCCLXVIII September
MCMXCIII in <URL:news:80r8bu$kcb$1@charm.magnus.acs.ohio-state.edu>:
:: [A complimentary Cc of this posting was sent to Anno Siegel
:: <anno4000@lublin.zrz.tu-berlin.de>],
:: who wrote in article <80r75q$fc$1@lublin.zrz.tu-berlin.de>:
:: > >Why do you think this script will print infinitely many copies of each
:: > >possible digit? Perl's rand() is not necessarily mapping to C rand(),
:: > >you know...
:: >
:: > I am sure something is escaping me in your reply. Anyhow...
:: >
:: > I you assume about Perl's rand() what is true of all pseudo-random
:: > generators, that it
::
:: Why do you think rand() is pseudo-random? It may be *random*. There
:: was some discussion on p5p about reading /dev/*random last year...
If it's random, it *will* generate all numbers, because it's run
for ever. For any sequence, the chance that it will not be generated
approaches 0 over time. ;-) If there's any sequence that will not be
generated with a chance > 0, rand() isn't random.
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54";
print if s/<<EOT/<<EOT/e;
Just another Perl Hacker
EOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 16 Nov 1999 08:02:07 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: getting started with MySQL and Perl
Message-Id: <m1zowe4e80.fsf@halfdome.holdit.com>
>>>>> "Brendan" == Brendan Reville <breville@mpce.mq.edu.au> writes:
Brendan> First, I got them to install the "Msql-Mysql-modules" tar,
Brendan> which I thought was the DBI layer.
It's actually the DBD layer. You talk to the DBI layer, specifying a
DSN that starts with "dbi:MySQL:...". That triggers the right DBD
backend driver, and you're set.
Brendan> But now when I try
Brendan> running my simple Perl test script, I get the following
Brendan> message.
Brendan> install_driver(mysql) failed: Can't find 'boot_DBD__mysql' symbol
Brendan> in /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
Brendan> Which perhaps (!?) indicates that the DBD module is missing.
Brendan> Any idea what I need to do to fix this?
Did you make all, make test, make install? If not, do that. If so,
what did "make test" say?
Did you use a prefix or a lib= to put it somewhere besides the normal
Perl installs? If so, did you add the right PERL5LIB or "use lib ..."
or "-I/path/to/lib" so that Perl could find the non-standard modules?
Answer those, and we'll be able to help more.
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 16 Nov 1999 15:47:55 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Hebrew HTML Clever Converter
Message-Id: <38317cab_1@newsread3.dircon.co.uk>
Yuval <yuval@mypad.com> wrote:
> a verey usful moudel is Lingua-IW-Logical-0_4_tar.tar.gz
>
> olkina@my-deja.com כתב בהודעה <80mqe4$fi5$1@nnrp1.deja.com>...
>>Looking for clever Perl or Java engine that can convert Hebrew texts
>>into HTML-logical files.
>>
>>
> begin 666 Lingua-IW-Logical-0_4_tar.tar.gz
Please do not do that - this is not a binary group. Either post the
unencoded uncompress unarchived file or if its too big post a URL
where it might be found ...
/J\
------------------------------
Date: Tue, 16 Nov 1999 11:08:30 GMT
From: michaelh@erols.com
Subject: Re: Help with Win32::Service
Message-Id: <38313ab3.1056724@news.erols.com>
I did post in a previous message the problem. Which is that I can not
get any of the function to properly run in this package. I keep
getting bad name after "$machine::" when I try to do a GetStatus.
On Mon, 15 Nov 1999 21:13:03 -0500, "Tex" <anti_spam@aspam101.com>
wrote:
>post ur problem so everyone can benefit.
>
>Tex ---
>
><michaelh@erols.com> wrote in message
>news:3828ef69.2805984@news.erols.com...
>> If anyone has experience with this module, could you please email me?
>
>
>
------------------------------
Date: 16 Nov 1999 14:31:00 GMT
From: nproj-2@mdstud.chalmers.se (Lab. - konto &)
Subject: How do I produce a random number?
Message-Id: <80rpr4$rnf$1@nyheter.chalmers.se>
Hi,
I have a problem with generating random numbers.
I'm using srand and rand but it doesn't work.
Any code-examples how to solver this are welcome!
/Joakim
------------------------------
Date: 16 Nov 1999 14:48:09 GMT
From: simon@brecon.co.uk (Simon Cozens)
Subject: Re: How do I produce a random number?
Message-Id: <slrn832rl9.lcb.simon@othersideofthe.earth.li>
Lab. - konto & (comp.lang.perl.misc):
>I'm using srand and rand but it doesn't work.
Works for me. Could you, perchance, say *what* you're doing, and *in
what way* it doesn't work? Then there might be a question to answer.
--
"By golly, I'm beginning to think Linux really *is* the best thing since
sliced bread."
(By Vance Petree, Virginia Power)
------------------------------
Date: Tue, 16 Nov 1999 16:00:53 +0100
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: How do I produce a random number?
Message-Id: <383171A5.4A1D0BA@ife.ee.ethz.ch>
Lab. - konto & wrote:
>
> Hi,
> I have a problem with generating random numbers.
> I'm using srand and rand but it doesn't work.
> Any code-examples how to solver this are welcome!
Wow, it doesn't work. How useful.
prompt> perl -le 'print rand'
Doesn't work
prompt>
------------------------------
Date: 16 Nov 1999 15:27:18 +0000 (GMT)
From: Ben Evans <bene@chiark.greenend.org.uk>
Subject: Re: how to create a random id?
Message-Id: <cym*13fdo@news.chiark.greenend.org.uk>
In article <80naus$3em@netline.jpl.nasa.gov>,
Peter Scott <psl@euclid.jpl.nasa.gov> wrote:
>In article <slrn82o6sl.lmh.abigail@alexandra.delanet.com>, abigail@delanet.com (Abigail) writes:
>> '' I want to generate in perl a random id like e3479b76955is5349
>> '' How can I make it?
>>
>> Use quantum effects.
>>
>> # Y2K compliant!
>> use Physics::Mechanics::Quantum;
>>
>> $id = '=' x 17;
>
>Did Hawking ever fix the bug in that module that was causing
>mini black holes to be created because they got the number of
>rolled-up dimensions wrong? (Who can blame them, I mean one
>week it's 7 another it's 11, some days it's 22...)
Actually, that's a feature, not a bug. Apparently it's a hint
from God that SUSY is supposed to be broken in higher dimensions,
rendering the non-Standard part of the spectrum unobservable.
Which is nice.[1]
kitty
[1] Assuming you wanted to spend some large and non-random amount
of money on having your mathematicians produce a theory with
exactly the same amount of predictive power as the Standard Model.
--
Ben Evans (bene@chiark.greenend.org.uk)
Just Another Evil-Policy Wielding Politely Frivolous High Density Random
Blonde Perl-Hacking Dilated-Eyed Gonzo Nancy Geek Kitten-Boy
------------------------------
Date: Tue, 16 Nov 1999 16:53:11 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Java faster than perl ?!?!?
Message-Id: <XZfY3.18598$YI2.797962@typ11.nn.bcandid.com>
In article <383084CA.B1431034@bigfoot.com>,
Ricardo Malta <RMalta@bigfoot.com> wrote:
>can some one tell me why this java script is so much faster than the
>perl one ??
A good implementation of Java can be faster than the current Perl
implementation. (I assume
>Could it come from the variable type ?? In java you difine it as integer
>and under perl it can be an integer, float, string, etc... ??
Dynamic typing does tend to make things slower. But type inference is
usually possible, and it can transform a dynamically-typed program into
a mostly-statically-typed program. I'd like to say that it's easier to
implement a statically-typed language to be fast, because you don't
have to do type inference, but Java has to do type inference in the
bytecode verifier anyway.
Current JVMs do a lot of optimizations that the Perl interpreter
doesn't even try to do; only some of them have to do with dynamic
typing.
Oh, and don't send MIME multipart stuff to Usenet. If you want us to
read your Perl, you should include it in the message. (And if you want
us to read your Java, you need to include it, too -- you didn't even
attach it.)
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 16 Nov 1999 16:54:50 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Java faster than perl ?!?!?
Message-Id: <u%fY3.18600$YI2.798055@typ11.nn.bcandid.com>
In article <XZfY3.18598$YI2.797962@typ11.nn.bcandid.com>,
Kragen Sitaker <kragen@dnaco.net> wrote:
>In article <383084CA.B1431034@bigfoot.com>,
>Ricardo Malta <RMalta@bigfoot.com> wrote:
>>can some one tell me why this java script is so much faster than the
>>perl one ??
>
>A good implementation of Java can be faster than the current Perl
>implementation. (I assume
(I assume 'java script' means 'Java program', not 'JavaScript program'.)
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 16 Nov 1999 13:16:53 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Longest match
Message-Id: <80rlg5$5es$2@nntp9.atl.mindspring.net>
Bart Lateur (bart.lateur@skynet.be) wrote:
: Imagine you have the text snippet:
:
: $_ = 'this is one that's two and this is three';
:
: How can you easily find the longest substring of only spaces (at least
: two)? Maybe even using only one regex? The aim is to find the best place
: to cut text like this into two columns.
Well, strictly speaking what you want to find is the *position* of the
longest substring of only spaces (I presume you're going to be doing this
to several lines, and then picking a position they share in common), so
I'd try something like:
my $llength;
my $lpos;
while (/(\s{2,})/g) {
if (length $1 > $llength) {
{$llength=length $1;
$lpos=pos()-$llength;
}
}
However, if you really are trying to split several lines into two
columns, you really need to get a list of *all* runs of spaces in each
line and "merge" it with the runs from previous lines (e.g. make a list
of runs for the first line, copy it to a "running list of runs" and then
for each additional line, use its list of runs to remove or narrow down
entries from the running list).
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 1394
**************************************