[8544] in Perl-Users-Digest
Perl-Users Digest, Issue: 2161 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 23 08:10:28 1998
Date: Mon, 23 Mar 98 05:01:04 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 23 Mar 1998 Volume: 8 Number: 2161
Today's topics:
Re: - Looking for a Linkchecker script - (__Olivier__)
ANNOUNCE: IndexMaker 5.3: an index.html maker from PDF, <pivari@geocities.com>
Re: Are There Any Snazzy Perl Editors for Windows? (Johannes Poehlmann)
Re: Calling all Newbies (Jeff Yoak)
Re: Calling all Newbies <stackhou@execpc.com>
Re: Can PERL run in the background? (Ian Kallen)
Re: Children, zombies, and REAPERs! (oh my!) (Johannes Poehlmann)
Re: compiling perl <tchrist@mox.perl.com>
connecting to a port like netcat does epronk@emt.ie.philips.nl
Embedding PERL <jbaudot@hptnonm.grenoble.hp.com>
empty directories <Beljaars@fys.ruu.nl>
Error handling with XS... <birney@sanger.ac.uk>
Re: help needed for a regexp (TomH)
Re: How do I do this? (newbie questions) <ewinter@pop3.stx.com>
Re: How do you create a directory? Please enlighten!? <ewinter@pop3.stx.com>
if/then - never mind kscope@the-city.com
Re: Is there a "Newsgroup" for Newbies to Perl? <tchrist@mox.perl.com>
Re: Is there a "Newsgroup" for Newbies to Perl? <tchrist@mox.perl.com>
Re: Perl NT-Unix problem <qdtcall@esb.ericsson.se>
Re: PerlRing??? (Frank)
psmulti & perl5 (aoct)
Re: Redirecting output <ewinter@pop3.stx.com>
relevance ranking using Perl audttjk@dbs.com.sg
Resource Kit installation woes <koos_pol@bigfoot.com>
Re: Trouble with alarm when waiting on <INPUT> <qdtcall@esb.ericsson.se>
Re: Wanted: email address gleaner <boys@aspentech.com>
window manager name in perl/tk <maxin@iscs.nus.edu.sg>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Mar 1998 12:02:42 GMT
From: omueller@stud.ee.StoPx.ch (__Olivier__)
Subject: Re: - Looking for a Linkchecker script -
Message-Id: <slrn6hcjhr.fnr.omueller@tardis-e3.ee.ethz.ch>
>for link checkers, see the documentation in the LWP family of
>modules. you might you check out Randal's WebTechnique articles [1].
>there is at least one devoted to this issue.
><URL:http://www.stonehenge.com/merlyn/WebTechniques/>
Ok, perfect, thanks ! It works fine under Linux (Perl 5.004), but
LWP modules aren't there in Win32 Perl : is that right, or did I made
something false ?
Olivier
--
Olivier Mueller | omueller@stud.ee.SToPx.ch
EE Student @ ETHZ | http://www.stud.ee.ethz.ch/~omueller
...Please replace "SToPx" by "Ethz" in my email to reply...
------------------------------
Date: Mon, 23 Mar 1998 10:01:30 +0000
From: Fabrizio Pivari <pivari@geocities.com>
Subject: ANNOUNCE: IndexMaker 5.3: an index.html maker from PDF,HTML,VRML and other files
Message-Id: <351632FA.6A6A9A9B@geocities.com>
Hi,
I'm glad to announce the version 5.3 of IndexMaker a perl script to make
an index.html file from PDF, HTML, VRML and other files.
At the moment, it uses the /Author field, the first /Title field and in
the /Subject field every matched PDF files, the <TITLE> </TITLE>
field and the META
Description and Author fields in every matched HTML files the Info
node field in every matched VRML 1.0 files the WorldInfo node field
info and title in every matched VRML 2.0 files and the name of the file
in the others.
What's new with version 5.3
Added match option. Now you can select the files you want find with
recursive option (ex. *.pdf, a?.*)
This is the URL where you can find the tool
http://www.geocities.com/CapeCanaveral/Lab/3469
--
Fabrizio Pivari
mailto:pivari@geocities.com
http://www.geocities.com/CapeCanaveral/Lab/3469/
Member of ANFACE Software
http://www.geocities.com/CapeCanaveral/Hangar/4794/
------------------------------
Date: 22 Mar 1998 00:00:00 +0000
From: j.poehlmann@link-n.cl.sub.de (Johannes Poehlmann)
Subject: Re: Are There Any Snazzy Perl Editors for Windows?
Message-Id: <6qNGUm03UkB@link-n-j.poehlmann.link-n.cl.sub.de>
(GNU) Emacs has a "perl mode".
------------------------------
Date: Mon, 23 Mar 1998 08:09:08 GMT
From: jeff@yoak.com (Jeff Yoak)
Subject: Re: Calling all Newbies
Message-Id: <6f55mo$56i@dfw-ixnews12.ix.netcom.com>
[posted and emailed]
"Doug Evans" <doug@ccinet.com> wrote:
>Hi,
>I would like to propose, that we "Newbies" set up a mail list, designed to
>help each other. I am "all the way up" to p. 25, of Learning Perl on Win32
>systems-:), and have already run into a number of problems. By the way,
>virtually every question that I have asked, on this newsgroup, was answered,
>or led me to the answer, to my problem.
>It seemed's to me, that if we formed a list, we could create a usable faq,
>based on our experiences, as newbies, struggling to learn, that would serve
>as a learning tool, for future newbies.
Doug,
If you create a mailing list to discuss Perl I wish you the best of
luck, but I'd like to make a comment about this last paragraph. I can
just imagine certain parties' hair falling out at the implication that
the current FAQ is unusable. Quite to the contrary, it is very
well-written and effective in addressing the most commonly encountered
problems. How do you hope to improve upon it by writing another FAQ?
If you have better answers to the questions in the list, I'm sure that
the authors would love to receive the improvements. If you have
questions that you find to be frequently asked that aren't in the
list, you can probably have them added with better answers than you
would likely be able to write qua "newbie."
Cheers,
Jeff
-------------------------------
Jeff Yoak jeff@yoak.com
------------------------------
Date: Mon, 23 Mar 1998 05:14:36 -0600
From: Mark Stackhouse <stackhou@execpc.com>
Subject: Re: Calling all Newbies
Message-Id: <6f5gf0$n7@newsops.execpc.com>
Doug,
Sign me up! Let me know what I can do to help.
--
Mark Stackhouse
***********************************************************************
homepage: http://www.execpc.com/~stackhou
"The best things in life aren't things."
--Art Buchwald
***********************************************************************
Doug Evans wrote:
>
> Hi,
>
> I would like to propose, that we "Newbies" set up a mail list, designed to
> help each other. I am "all the way up" to p. 25, of Learning Perl on Win32
> systems-:), and have already run into a number of problems. By the way,
> virtually every question that I have asked, on this newsgroup, was answered,
> or led me to the answer, to my problem.
>
> It seemed's to me, that if we formed a list, we could create a usable faq,
> based on our experiences, as newbies, struggling to learn, that would serve
> as a learning tool, for future newbies.
>
> Any takers?
>
> Doug Evans
--
Mark Stackhouse
***********************************************************************
homepage: http://www.execpc.com/~stackhou
"The best things in life aren't things."
--Art Buchwald
***********************************************************************
------------------------------
Date: 23 Mar 1998 06:46:11 GMT
From: spidaman@well.com (Ian Kallen)
Subject: Re: Can PERL run in the background?
Message-Id: <6f50fj$af$1@was.hooked.net>
Charles Jaimet (webmaster@netminder.com) wrote:
: Ideally I'd like the user to stay on the form page after submitting the
: form.
#!/usr/local/bin/perl
# this really belongs in comp.infosystems.www.authoring.cgi right?
print "Location: $ENV{HTTP_REFERER}\n\n"
exit();
--
Ian Kallen <spidaman@well.com>
"Like so many Americans, she was trying to construct a life that made
sense from things she found in gift shops."
-- Kurt Vonnegut, Jr.
------------------------------
Date: 22 Mar 1998 00:00:00 +0000
From: j.poehlmann@link-n.cl.sub.de (Johannes Poehlmann)
Subject: Re: Children, zombies, and REAPERs! (oh my!)
Message-Id: <6qNGVHT3UkB@link-n-j.poehlmann.link-n.cl.sub.de>
mhazen (Mark Hazen) schrieb zu Children, zombies, and REAPERs! (oh my!):
> while(1)
> {
> #do some stuff
> \&REAPER;
> # spawn a child process
> sleep 100;
> }
>
> sub REAPER
> {
> $waitedpid = wait;
> $SIG{CHLD} = \&REAPER;
> }
>
try a loop that does a non blocking wait.
This should end all zombie processes.
See also:
perldoc Posix Module.
man wait
------------------------------
Date: 23 Mar 1998 11:17:07 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: compiling perl
Message-Id: <6f5gbj$lr4$3@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, "Cory S. Moll" <Cory-M@usa.net> writes:
:Oh heh. I remember this program. It made huge exe files when it was done.. a
:simple 6K perl script was turned into a 6M executable.
Plus it does not compile your program. This is an often-repeated untruth.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"To steal from one person is theft. To steal from many is taxation."
--Daiell's Law (a take-off on Felson's Law)
------------------------------
Date: Mon, 23 Mar 1998 04:43:54 -0600
From: epronk@emt.ie.philips.nl
Subject: connecting to a port like netcat does
Message-Id: <6f5e9b$j5b$1@nnrp1.dejanews.com>
How can I easily connect to a port like netcat does?
I want to do someting like:
FH = something('somehost', $someport);
select FH;
$a = <>;
if ($a eq 'login:')
{
print 'myusername';
}
Eddy
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 23 Mar 1998 11:13:57 +0100
From: jacques baudot <jbaudot@hptnonm.grenoble.hp.com>
Subject: Embedding PERL
Message-Id: <351635E5.44938F27@hptnonm.grenoble.hp.com>
Hello folks,
I'm currently working on using the PERL WIN32 DLL embedded in an
application. I am facing problems with compilation options, as I want to
use PERL WIN32 embedded in a C application, thus avoiding PERL object
considerations. I am working with the 316 version of the sources.
Has anybody tried the same and could give me an help?
Thanks!!
------------------------------
Date: Mon, 23 Mar 1998 08:15:43 GMT
From: Haaino Beljaars <Beljaars@fys.ruu.nl>
Subject: empty directories
Message-Id: <35161A2D.E47E0713@fys.ruu.nl>
--------------66071400F6D8578691C240E0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
As you can see, I have copied some perl lines from
http://www.stonehenge.com/merlyn/UnixReview/col16.html
Can anybody tell me how to change this script so that it only deletes
empty directories from the user 'guest', but not the directory
'/home/guest/' . Any help would be greatly apprisiated.
#!/usr/bin/perl
&smash("/");
sub smash {
my $dir = shift;
opendir DIR, $dir or return;
my @contents =
map "$dir/$_",
sort grep !/^\.\.?$/,
readdir DIR;
closedir DIR;
foreach (@contents) {
next unless !-l && -d;
&smash($_);
rmdir $_;
}
}
--
Greetings from Haaino Beljaars
--------------------------------------------------
E-Mail: Beljaars@fys.ruu.nl -
Home Page: HTTP://www.fys.ruu.nl/~beljaars/ -
File not found. Should I fake it? (Y/N) -
Beware of programmers who carry screwdrivers. -
--------------------------------------------------
--------------66071400F6D8578691C240E0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
Hi,
<P>As you can see, I have copied some perl lines from
<BR> <A HREF="http://www.stonehenge.com/merlyn/UnixReview/col16.html">http://www.stonehenge.com/merlyn/UnixReview/col16.html</A>
<BR>Can anybody tell me how to change this script so that it only deletes
empty directories from the user 'guest', but not the directory '/home/guest/'
. Any help would be greatly apprisiated.
<BR>
<P>#!/usr/bin/perl
<P> &smash("/");
<BR> sub smash {
<BR> my $dir = shift;
<BR> opendir DIR, $dir or return;
<BR> my @contents =
<BR> map "$dir/$_",
<BR> sort grep !/^\.\.?$/,
<BR> readdir DIR;
<BR> closedir DIR;
<BR> foreach (@contents) {
<BR> next unless !-l &&
-d;
<BR> &smash($_);
<BR> rmdir $_;
<BR> }
<BR> }
<BR>
<PRE>--
Greetings from Haaino Beljaars
--------------------------------------------------
E-Mail: Beljaars@fys.ruu.nl -
Home Page: <A HREF="HTTP://www.fys.ruu.nl/~beljaars/">HTTP://www.fys.ruu.nl/~beljaars/</A> -
File not found. Should I fake it? (Y/N) -
Beware of programmers who carry screwdrivers. -
--------------------------------------------------</PRE>
</HTML>
--------------66071400F6D8578691C240E0--
------------------------------
Date: Mon, 23 Mar 1998 08:17:21 +0000
From: Ewan Birney <birney@sanger.ac.uk>
Subject: Error handling with XS...
Message-Id: <35161A91.41C6@sanger.ac.uk>
I tried this post in comp.perl.modules to no avail...
I have made a pretty comprehensive port of my nice (fast-and-small)
C set of routines into Perl (fast-flexible-and-more than anyone wants),
which I think will be a a great combination. I have two problems:
a) handling warning errors sensibly
b) what to do with pointer to functions in C space which could
possibly be useful from Perl.
My thoughts on a) are:
i) - just shove everything out to stderr (but I want a 'carp' sort of
thing - so people know where they called it)
ii) - stack errors as you go into the C area: when come out, get
a perl function to to walk down the error stack, 'carping' as it
pulls things out of it.
- Reasons I don't like this:
a) some routines can take days to process (db searching code)
and people are not going to see things to the end. v.v.v bad
b) stack could get v. large
c) messy. Too much glue code.
iii) - beforing entering C space, push my perl 'location' (ala carp)
into a C buffer. Chuck warnings out on STDERR but with a
perl location.
- Currently this is my favourite.
iv) - ? something else
Now b)
??? has anyone tried to do this. Commonly I allow pointers to functions
to set names and other quite 'user defined' things in the guts of my
functions.
I'm convinced that people better than me have thought about this,
but I can't find anything around perl.com/org so... please... guru
perl people...
ewan
------------------------------
Date: Mon, 23 Mar 1998 06:39:01 GMT
From: beans@bedford.net (TomH)
Subject: Re: help needed for a regexp
Message-Id: <3516031a.1805906@news.bedford.net>
Not to cast aspersions on doswald, but this is a good argument for not
having a Newbie Newsgroup.
nickhill the virgin should learn how to do the splits:
perlfunc
split - Splits a string into an array of strings, and returns it.
On Mon, 23 Mar 1998 04:48:02 GMT, doswald@xmission.com (David Oswald)
wrote:
>On 22 Mar 1998 16:17:40 GMT, "nick hill" <nick.hill@virgin.net> wrote:
>
>>If I have the variable $line = "1234,nick,hill,company,3"
>>what regexp do I use to get the folowing result.
>>
>>$line1 = 1234
>>$line2 = nick
>>$line3 = hill
>>$line4 = company
>>$line5 = 3
>
>That depends on context and what exactly you're trying to match. Do
>you wish to match the literals as quoted above? In that case here's
>an RE that will do it for you:
...
------------------------------
Date: Mon, 23 Mar 1998 06:48:03 -0500
From: "Eric Winter" <ewinter@pop3.stx.com>
Subject: Re: How do I do this? (newbie questions)
Message-Id: <6f5i6d$jfq@post.gsfc.nasa.gov>
Digital Puer wrote in message <3513FE09.53AEDEB2@hotmail.com>...
>I'm a newbie who wants to migrate slowly from using
>shell scripts to perl. Please tell me how I can do
>this construct (which I use the most):
>
>foreach file (*.whatever)
> blah
>end
foreach $file (<*.whatever>) {
blah($file);
}
>Also, is there a built-in way to get the length of
>a file, besides $filelength = `wc -l file` ?
Use stat() to get byte length. For line length, count them yourself.
>And also the number of files in a directory besides
>`ls | wc -l` ?
Use opendir() and count them.
HTH
Eric
------------------------------
Date: Mon, 23 Mar 1998 06:49:33 -0500
From: "Eric Winter" <ewinter@pop3.stx.com>
Subject: Re: How do you create a directory? Please enlighten!?
Message-Id: <6f5i98$jjl@post.gsfc.nasa.gov>
Use mkdir() to create a directory, and rmdir() to delete it.
Mark Polakow wrote in message <6erdss$qhe$1@viper.america.net>...
>Ok. be gentle, Im a begginner programmer. I am working on a web-based file
>management program and I have it doing everything but i don't know the code
>or method for creating directories? I know about unlink and rmdir can
>someone please send me a snippet of code that deletes a directory or
>otherwise, and in real simple words, point me in the direction... Thank you
>very much in advance!
>
>
------------------------------
Date: Mon, 23 Mar 1998 01:55:57 -0600
From: kscope@the-city.com
Subject: if/then - never mind
Message-Id: <6f54eg$8sr$1@nnrp1.dejanews.com>
my apologies for the panic - took a break, came back at it with fresh eyes and
figured it out - funny how those little 'my's before $... make all the
difference in the world <grin>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 23 Mar 1998 11:09:23 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6f5ft3$lr4$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Mark Stackhouse <stackhou@execpc.com> misused
Mozilla 4.04 [en] (Win95; I) to mutilate the following:
:The corporation I work for has eliminated nearly half
:of our
:professional programmers and totally eliminated our software
:training
:staff. We now must resort to satellite transmissions and
:video tape to
:learn software applications. Engineering is expected to
:shoulder the
:responsibilities previously assigned to the Software Support
:Group. No
:new requests are being accepted.
Then you are totally screwed. We can't help you. You'll never get
your custodial staff to write you a new device driver. This is just
asking far too much.
But you might think about getting a newsreader that doesn't mutilate
your postings so badly. :-(
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
> This made me wonder, suddenly: can telnet be written in perl?
Of course it can be written in Perl. Now if you'd said nroff,
that would be more challenging... --Larry Wall
------------------------------
Date: 23 Mar 1998 11:05:38 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6f5fm2$lr4$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Mark Stackhouse <stackhou@execpc.com> writes
a terribly mutilated, miswrapped posting:
:If you, (or anyone else for that matter), knows of a better
:language that non programmers can utilize to get some REAL
:work done, I'm all ears!
Nonprogammers should not use any programming language. Period.
Nonsurgeons should perform any surgical interventions. Period. This is
a profession, you know. If you aren't a programmer, hire one.
"C/Java/C++/Perl for Non-programmers" is oxymoronic.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"I think the pod should be the master...."
--Larry Wall in <9410072305.AA03994@scalpel.netlabs.com>
------------------------------
Date: 23 Mar 1998 13:55:34 +0100
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: Perl NT-Unix problem
Message-Id: <isd8fdbm7t.fsf@godzilla.kiere.ericsson.se>
Mark Sage <Mark_Sage@Compuserve.com> writes:
> The script bombed out, receiving no help from my ISP I tracked the
> fault down to the use of "MY", when I took this out and made the
> variables global everything worked fine. Why?
The my() construction was included into Perl in 1994 (or was it
1993?). Perhaps your ISP is running a Real Old version of Perl, like
perl4?
If so, you can always use the security bugs in that version to crack
their site and upgrade for them...
--
Calle Dybedahl, UNIX Sysadmin
qdtcall@esavionics.se http://www.lysator.liu.se/~calle/
------------------------------
Date: 23 Mar 1998 13:46:51 +0100
From: dont_use_this_ey@hotmail.com (Frank)
Subject: Re: PerlRing???
Message-Id: <yo9hg4pefr8.fsf@nym.sc.philips.com>
Randal Schwartz <merlyn@stonehenge.com> writes:
> Joergen> If people who have first time contact with their
> Joergen> distribution of Perl and find the docs in a format, they're familiar
> Joergen> with they might even make an effort to have a look at it.
>
> Right. "perldoc" seems to be working nearly everywhere now that has a
> command line. So, we're there.
Hello!
I asked before and this seems to be a good place to repeat.
I'm trying to use perl 5.004_04 on NT 4.0 SP3,
build from http://language.perl.com/CPAN/src/latest.tar.gz
perldoc.bat perldoc
pops up an empty editor window. Is there somewhere a hidden agreement
which tool is used to show the output of perldoc.bat? Which
environment variables/pathes/applications have to be set/installed to
allow reading the documentation?
For all the HTML fans out there: I even tried using HTML in order to
get the perldoc.bat thing working. Unfortunately my browser (IE 3.0)
there does not understand the used URL syntax
(//F|dir1/dir2/..../file.html) in the perl HTML documentation. And no
I will never upgrade this browser. (While trying to free the occupied
discspace my NT system vanished. Now the browser simply stays there.)
And yes in the meantime I'm able to read the HTML version of the doc,
but still no real idea how to get perldoc.bat to work as expected.
Any hints?
regards
Frank
------------------------------
Date: Mon, 23 Mar 1998 13:47:07 +0100
From: "bultman g.w. (aoct)" <bultman@rikz.rws.minvenw.nl>
Subject: psmulti & perl5
Message-Id: <351659CB.6C7C@rikz.rws.minvenw.nl>
I've recently deleted perl4 from our system (we only used it
for psmulti, an application that prints postscript files n-up)
Unfortunately, psmulti doesn't works with perl5_004.
Does anybody have experience in porting psmulti to perl5
or is thee another cause for my problem?
Answers by e-mail to bultman@rikz.rws.minvenw.nl
Thanks for any and all help.
Gert Bultman
--
o Gert Bultman <g.w.bultman@rikz.rws.minvenw.nl> o
/ | \ SNAILMAIL: National Institute for Coastal & Marine / | \
o--o--o Management, P.O.Box 20907, 2500 EX The Hague, o--o--o
\ | / The Netherlands (Mark your envelope "PERSOONLIJK") \ | /
o Phone (..31) 70 3114297 o
------------------------------
Date: Mon, 23 Mar 1998 07:01:51 -0500
From: "Eric Winter" <ewinter@pop3.stx.com>
Subject: Re: Redirecting output
Message-Id: <6f5j0c$jnv@post.gsfc.nasa.gov>
sflorcsk@email.aphis.usda.gov wrote in message
<6eurgj$fa9$1@nnrp1.dejanews.com>...
>Here's my question. Instead of redirecting the output of this subroutine to
>the screen (which works successfully), I want to redirect it to a file, in
>PERL (not Oracle).
>
>So far, I've tried:
>&sql("username/password",@sql_code) >"/opt/users/scott/results.ascii";
>
>but no luck. Any help would be appreciated.
Using that technique is a shell-ism. If the output goes to stdout, open your
file first, then use select():
...
open(FH, ">/opt/users/scott/results.ascii") or die;
$oldHandle = select(FH); # Usually STDOUT
&sql("username/password",@sql_code); # Output goes to your file.
select($oldHandle); # Back to where you started.
close(FH);
...
HTH
Eric
------------------------------
Date: Mon, 23 Mar 1998 05:07:37 -0600
From: audttjk@dbs.com.sg
Subject: relevance ranking using Perl
Message-Id: <6f5fl8$k9v$1@nnrp1.dejanews.com>
I am trying to implement a relevance ranking part of a search engine
in Perl since I don't have time to write it in C.
I have a table with a column which stores comma/space-separated words.
I am trying to take a set of user-supplied search words and match
against the text in that column in each row of the table.
In order to count the score for a particular row, I use array of hashes
to store the score and other information unique to each row.
And then I have to sort the array based on score later to do the ranking.
I plan to write a C database interface which, among other things, prints
out Perl's code (something like the code below) which can then be evaled by
Perl Interpreter at run time to rank the result.
My question is, is this the most efficient algorithm/method ?
And any optimization can be done ? Given the following:
1. $text1,$text2 and so on are comma or space separated English words.
2. $pat1 - $pat3 are short English keywords that never change.
--------------------------------------------------------------------
$pat1 = 'keyword1'; # user search keyword
$pat2 = 'keyword2';
$pat3 = 'keyword3';
# Here starts the output from a FOR loop in C
$text1 = 'keyword1,keyword3,keyword1,other words,keyword2'; # text from row 1
in table
$document[0]{score}++ while ($text1 =~ m/$pat1/go);
$document[0]{score}++ while ($text1 =~ m/$pat2/go);
$document[0]{score}++ while ($text1 =~ m/$pat3/go);
$text2 = 'Unrelated words,keyword2,keyword3,other words'; # text from row 2 in
table
$document[1]{score}++ while ($text2 =~ m/$pat1/go);
$document[1]{score}++ while ($text2 =~ m/$pat2/go);
$document[1]{score}++ while ($text2 =~ m/$pat3/go);
....
------------------------------------------------------
Thanks a lot,
Jit Kiat Tan
audttjk@dbs.com.sg
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 23 Mar 1998 09:55:05 +0100
From: Koos Pol <koos_pol@bigfoot.com>
Subject: Resource Kit installation woes
Message-Id: <35162369.7800@bigfoot.com>
I have difficulties installing the Perl Resource Kit on my Linux
RedHat box.
When firing 'setup', a form is presented and needs to be filled in.
Alas, this form can't hold all entry fields. So on the bottom of the
form I miss a few fields. I think that the Accept/Cancel/Quit/...
buttons are also at the bottom of the form.
When I resize the form and pull the formhandle down, the resizing
stops just a few fields above the bottom. The formhandle *refuses* to
be pulled down further. So my install stops here...:-(
Anyone familiar with this problem and knows what to do about it?
Much appreciated!
Koos Pol
----------------------------------------------------------------------
S.C. Pol tel: +31 20 3116122
Systems Administrator email: Koos_Pol@bigfoot.com
Compuware Europe PGP public key available upon request
A little inaccuracy sometimes saves tons of explanation.
-- H. H. Munroe
------------------------------
Date: 23 Mar 1998 13:41:36 +0100
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: Trouble with alarm when waiting on <INPUT>
Message-Id: <isemztbmv3.fsf@godzilla.kiere.ericsson.se>
Jacob Langford <langford@uiuc.edu> writes:
> I use the system command "ping" and always use the
> function "alarm" to terminate the ping session. The program
> hangs up on machines that don't respond, I presume because
> alarm doesn't work when I'm waiting on <INPUT>.
This sounds quite OS-dependent, but my guess is that your signal isn't
being delivered while the child ping is waiting for a timeout.
> Any ideas?
Net::Ping saves you a child process and lets you set the timeout value.
--
Calle Dybedahl, UNIX Sysadmin
qdtcall@esavionics.se http://www.lysator.liu.se/~calle/
------------------------------
Date: Mon, 23 Mar 1998 12:54:46 +0000
From: Ian Boys <boys@aspentech.com>
Subject: Re: Wanted: email address gleaner
Message-Id: <35165B96.2781@aspentech.com>
Jeff,
I think, through no fault of your own, you have chosen the wrong
newsgroup to post your question in. You have probably come from a
background of friendly groups, populated by people who share a common
interest, with a sense of community spirit and a desire to help each
other.
My impression, after lurking in this group for a while, is that any
sense of community spirit was driven out long ago. Sadly, many of the
knowledgeable people who remain have become jaded and cynical, and tend
to pounce on anyone who doesn't ask a "pure" Perl question. And we all
get driven insane by spam, so any suggestion that you might want to send
it is not likely to be warmly received.
If I were you, I would cut your losses and head sadly back to the
friendly newsgroups that you and I know are out there.
Ian
------------------------------
Date: 23 Mar 1998 07:20:12 GMT
From: Ma Xin <maxin@iscs.nus.edu.sg>
Subject: window manager name in perl/tk
Message-Id: <6f52fc$am11@id4.nus.edu.sg>
how to get the name of window manager(eg. twm, mwm, fvwm, etc) in perl/tk?
_____
Best Regards,
Ma Xin
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2161
**************************************