[9536] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3130 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 11 23:07:39 1998

Date: Sat, 11 Jul 98 20:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 11 Jul 1998     Volume: 8 Number: 3130

Today's topics:
    Re: Choosing DBMS: friendly to Linux, Apache, Perl, Jav <shaspari@ctv.es>
    Re: Does your Web host offer ....? (Greg)
    Re: Getting a web page before a process finishes.. (brian d foy)
    Re: Getting Yesterday's Date (Chip Salzenberg)
    Re: Hash keys question (Mark-Jason Dominus)
    Re: hash's and a foreach - Can't do it? <maierc@chesco.com>
    Re: HELP: Internet Database Design questions... <craig@bones.org>
    Re: HELP: Internet Database Design questions... <mdkersey@hal-pc.org>
    Re: HELP: Internet Database Design questions... <mdkersey@hal-pc.org>
    Re: How can you encrypt a CGI script on a server so it  (-)
        more flock woes.. (Alex Krohn)
    Re: new charter and moderator for comp.lang.perl.announ (Abigail)
        Perl to populate Access 97 database <edwardv@jps.net>
        Perl to write data to Access database <edwardv@jps.net>
        PING / Traceroute Perl Script <jesse@savalas.com>
    Re: Putting CPAN on a CD:  good or not good? (brian d foy)
    Re: PUZZLE: make hat, take ham <bowlin@sirius.com>
    Re: PUZZLE: make hat, take ham (Daniel S. Lewart)
        REPOST: Re: I am an "antispam spammer"? <3srf@qlink.queensu.ca>
        Webresource.net <rishi@webresource.net>
        Willing to pay for script.. (Alex Kovalenko)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 12 Jul 1998 01:21:53 +0200
From: w95killer <shaspari@ctv.es>
To: gordo@pclink.com
Subject: Re: Choosing DBMS: friendly to Linux, Apache, Perl, Java
Message-Id: <35A7F391.2DBF4B96@ctv.es>

You can see Ingres form Computer Associates too


gordo@pclink.com escribis:

> I know that this question probably doesn't have a simple answer, and in
> fact I probably need lots of help just to formulate a better question,
> and maybe I'm not asking in the right place, either....  Anyway, here
> goes.
>
> I am just in the process of setting up Apache 1.3 on a small Linux (home
> office) server running RedHat 5.1.  I need a database backend for Apache
> and other uses, including Java and CORBA code and data repository.  I
> use Perl for most work so it's a plus if there already is a DBD module
> out there for the database.
>
> I would like to use Oracle because that's my normal working environment at
> clients' but at $1000+ the cost is hard to justify, plus AFAIK Oracle doesn't
> run on Linux (yet).  So I'm looking for a less costly database that wouldn't
> hamstring me if I eventually needed to move to a more capable system or even
> to Oracle itself.  And I must admit, I want the best one!:-)  Am I just
> kidding myself to think that such exists for Linux?  There seems to be a
> plethora of products out there.
>
> Database need not be free of cost or licensing restrictions.  Closer to
> ANSI-92(?) is better and probably closer to Oracle 7.3 is even better though
> I suppose that's a dream--until I started digging into this I didn't realize
> just how proprietary much of Oracle's working and development environment is.
>
> Thanks in advance for your opinions.
> --
> Gordon Pedersen         1412 Portland Ave
> info systems design     Saint Paul, Minnesota
> gordo@pclink.com        55104,  USA
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum





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

Date: Sat, 11 Jul 1998 22:08:51 GMT
From: gafntaf@ptld.uswest.net (Greg)
Subject: Re: Does your Web host offer ....?
Message-Id: <35a7e230.46757724@news.ptld.uswest.net>

On Sat, 11 Jul 1998 19:39:22 GMT, megauser@my-dejanews.com had said
something like:

>Does your web host offer An online editor which allows for HTML,JavaScript,
>Java,C/C++,DHTML etc.  Plus have integrated Tutorials,Chats,References,and
>Newsgroups to help you out along the way?  Push button compiling and Debugging
>of Server Side Scripts? Push button HTML and JavaScript Preview? Easy to use
>web integrated Web site managment?
>
>Plus...Support for Primary and Secondary domains?
>
>Here is one that does...all in one place....No Unix is required...30 day free
>trial.
>
>http://www.useractive.com
>
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum
So, if the server is down, tough #$%^ if you want to edit/update the
page.
No thanks, I'll edit off-line and upload. TYVFM.

If most car accidents occur within five miles of home, why
doesn't everyone just move 10 miles away?

ICQ#:14232895 or send an e-mail to: 14232895@pager.mirabilis.com
http://www.lionheartdesigns.com/area51/deadhorse.htm


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

Date: Sat, 11 Jul 1998 22:20:27 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Getting a web page before a process finishes..
Message-Id: <comdog-ya02408000R1107982220270001@news.panix.com>
Keywords: from just another new york perl hacker

In article <max_eper-1107980254380001@ts001d17.min-mn.concentric.net>, max_eper@hotmail.com (Steve Swantz) posted:

>I'm using a web form to mail a message to a list of subscribers. Right
>now, I'm trying fork(). One process writes the page, then sends one
>e-mail, while the other process takes on the big mailing. The problem -
>the page will not appear until both processes are done, even though an
>e-mail sent following the printing of the HTML arrives pronto. IOW, mail
>sent after the page is printed arrives long before the page appears.

why nopt just send the page then use the same proces to handle the
rest?

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>


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

Date: Sun, 12 Jul 1998 01:50:47 GMT
From: chip@pobox.com (Chip Salzenberg)
Subject: Re: Getting Yesterday's Date
Message-Id: <6o94sf$alm$1@cyprus.atlantic.net>

According to tchrist@mox.perl.com (Tom Christiansen):
>In comp.lang.perl.misc, 
>    allbery@kf8nh.apk.net writes:
>:Technically, though, he's correct:  what about leap seconds?  :-) :-)
>
>Leap seconds are ignored.

Without your saying who ignores them, you're not saying much.
-- 
Chip Salzenberg                - a.k.a. -               <chip@pobox.com>
"I brought the atom bomb.  I think it's a good time to use it."  //MST3K
           ->  Ask me about Perl training and consulting  <-
     Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: 9 Jul 1998 11:41:03 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Hash keys question
Message-Id: <xxxx6o2oaf$3mp$1@monet.op.net>


I am a sample article.


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

Date: Sun, 12 Jul 1998 02:47:14 GMT
From: Charles Maier <maierc@chesco.com>
Subject: Re: hash's and a foreach - Can't do it?
Message-Id: <35A7C53C.7A@chesco.com>

jevon@my-dejanews.com wrote:
> 
> I would like to get some opinnions on how to append to a hash within a
> foreach..
> 
> eg.
> 
> I would like to do this:
> 
> %items = (
>         $name => $value{$name}
> );
> 
> but $value and $name are arrays. And I need to sort through them.. What I can
> do in a foreach..
> 
> eg.
> 
> This is what I would think would work.
> 
> foreach $name (@name) {
>        %items = ($name => $value{$name})
> }
> 
> I tried a push but I can't push a hash..
>

You call $value an    array  and use it like a hash.. and call $name an
array and use it like an array and a hash.... which is it?? 

If you are new at perl..it might help to use a differently named
variable on the foreach line (like $i) instead of $name. 


-- 
Chuck Maier
CDM Consulting Services
http://www.cdmcon.com
(610) 943-2726


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

Date: Sat, 11 Jul 1998 19:35:22 -0400
From: Craig Bloom <craig@bones.org>
Subject: Re: HELP: Internet Database Design questions...
Message-Id: <35A7F6BA.CD772C46@bones.org>

Geez... the guy just wants to add a little database functionality, and it
doesn't even sound mission-critical.  These Unix snobs really irk me
sometimes.  Why overcomplicate the matter for someone who is just getting
started?  I agree... NT, IIS, ASP and Access for quick development and fast
results.  And it is a nice introduction to database manipulation for those
who haven't put their foot in the water yet.  Later move it to MSSQL Server
if you need it to be more robust.  The transition should be fairly painless.

OR you can waste many hours learning your way around the unix operating
system, teaching yourself perl and stuffing data into (real efficient, yeah
right) flat file databases.  Boy, tough choice.

OK, now you can tell us again how much smarter you are because you use unix.



No-name guy wrote:

> Catherine Skidmore <eppie@interport.net> Said this:
>
> >Avi Goldenberg wrote:
> >
> >> 1)  What are the current technologies needed to achieve the minimum of
> >> data storage, retrieval, and manipulation?  (I prefer to stay NT as
> >> opposed to UNIX)
> >
> >ooh. Access and ASP. or Access and Cold Fusion.
>
> Oh my GOD.  No.
>
> >
> >> 2)  What do I need to look for in a hosting service to allow me to
> >> achieve #1?
> >
> >an NT Box running IIS.
> >
>
> Argh.  New to computing?  Must be.





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

Date: Sat, 11 Jul 1998 18:47:39 -0500
From: "Michael D. Kersey" <mdkersey@hal-pc.org>
To: Avi Goldenberg <mozzer@earthlink.net>
Subject: Re: HELP: Internet Database Design questions...
Message-Id: <35A7F99B.2D1EA9F@hal-pc.org>

Avi Goldenberg wrote:

> Hi...
> *sigh*  For being someone who though they were technically competent, I am
> suddenly humbled into a quivering child!

You are technically competent! It's just that other people have been busy
creating other things while you weren't looking. Now you're just catching up
with them. You undoubtedly could frighten them with what you have been doing
in the meantime!-)Now the good news:
a) you're ahead of probably 90% of your programming brethren,
b) what you will do is fun and interesting, and
c) it's probably easier than what you've been doing before (but don't tell
your boss or mine).

> I need some help understanding (or at least pointed towards a great text
> or two on) a good approach towards setting up a web site that has
> interactive database abilities.
>
> My current problems are that I don't know:
> *  What technologies are need today or are currently used
> *  What hosting setup do I need that will give me the capabilities to
> perform
> *  What is a good book (text) to help me get a grip on this!

Since you want to run on NT you'll probably run on Microsoft's IIS and use
Microsoft's ASP(Active Server Pages). Most of the programming is done in
VBScript (a subset of Visual Basic with features stolen from Perl) and/or
JavaScript. An excellent book for such development is "ASP Active Server
Pages" by Andrew M. Fedorchek & David K. Rensin (1997, IDG Books). If you
are a little familiar with NT or Win95 and are already programming in some
language, it will be the quickest introduction. If you have more time the
Wrox "Active Server Pages 2" book by Homer, Enfield, Gross, Harrison,
Francis, Jakab and Gill (Wrox Press, 1997) is also good, but weighs about 3
times as much. You can also run Perl on NT (in all honesty, the problems in
most shops is somewhat a religious/political one) using IIS and ASP.

This group's archives can be viewed at http://www.dejanews.com/ where, using
the Power Search option, you can scan for individual's posts on using Perl
under Windows NT. Also visit http://www.perl.com/ and look for the FAQ on
the sidebar and read about running Perl on Windows 95 and NT.  I used Eric
Herrmann's book, "CGI Programming with Perl 5" (Sams Net, 1996, there's a
newer, better-organized edition) as my first read on www programming and, in
retrospect, it was pretty complete. Problem is, at the time, he kept telling
me things that didn't seem relevant then, but when I look back they make
sense. I guess he taught me something!

Be aware that the www was conceived in a Unix world and  has a history. If
you think only in terms of  NT systems then you will never fully understand
the internet. To understand it better you should at some time trace it's
development in Unix. I like Douglas E. Comer's "The Internet Book"
(Prentice-Hall, 1995) for this: it isn't too technical but shows the details
sufficiently to initially satisfy your curiosity. You can fill in the gaps
later. And if you _really_ want to understand it then you should get LINUX
and set up a server yourself and then learn Perl and revisit this newsgroup.
If you have a background in Unix, then you definitely should take the
LINUX/Perl path.

> My initial goal is simply to design a few pages that accept information
> via forms, store it, and will use simple search and retrieval functions to
> re-display stored data in various forms.
>
> If someone can PLEASE email me and mentioned a good book or two to discuss
> the technologies I need to learn, I would _really_ appreciate it.  At the
> least, if someone could answer:
>
> 1)  What are the current technologies needed to achieve the minimum of
> data storage, retrieval, and manipulation?  (I prefer to stay NT as
> opposed to UNIX)
> 2)  What do I need to look for in a hosting service to allow me to achieve
> #1?

Lots of ISP's provide IIS and ASP support. Just find one that has an NT
machine. Or you can develop ASP code on your own Win95 or NT machine with
Microsoft's Personal Web Server, which, together with ASP, can be downloaded
for free from Microsoft's website at http://www.microsoft.com/

> THANKS in advance!
> mozzer@earthlink.net

  BTW, you're probably asking this question on the wrong newsgroups: please
go to the Microsoft news server (msnews.microsoft.com) and look up the
microsoft.public.inetserver.iis.activeserverpages newsgroup (and others as
you wish). One advantage:  that group is a lot more tolerant of naive
questions than this one is!-))



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

Date: Sat, 11 Jul 1998 19:31:01 -0500
From: "Michael D. Kersey" <mdkersey@hal-pc.org>
Subject: Re: HELP: Internet Database Design questions...
Message-Id: <35A803C5.68B2EE64@hal-pc.org>

Craig Bloom wrote:

> Geez... the guy just wants to add a little database functionality, and it
> doesn't even sound mission-critical.  These Unix snobs really irk me
> sometimes.  Why overcomplicate the matter for someone who is just getting
> started?  I agree... NT, IIS, ASP and Access for quick development and fast
> results.  And it is a nice introduction to database manipulation for those who
> haven't put their foot in the water yet.  Later move it to MSSQL Server if you
> need it to be more robust.  The transition should be fairly painless.
> OR you can waste many hours learning your way around the unix operating
> system, teaching yourself perl and stuffing data into (real efficient, yeah
> right) flat file databases.  Boy, tough choice.
> OK, now you can tell us again how much smarter you are because you use unix.
> <snipped>

You may be right in suggesting that a person take the easy road to get started,
especially if it is to make a living.

But make no mistake, they (the Unix people) are undoubtedly smarter technically.

Unix and mainframe technology is all around you, running the infrastructure of
the world every hour of every day. The entire field of "Computer Science" and
almost every system of significance in use today was created and developed, not
by computer science majors working on Windows machines but by physicists,
mathematicians, engineers and individuals from every walk of life who saw an
interesting tool and wanted to work on it. For this reason, you should
(privately at least) pay your respects to these individuals and their
intellectual descendents. They have done beautiful work and accumulated
knowledge from both study and experience: for this reason you should read their
papers and learn from them. For example:
a) Read the documentation on Unisys(then Sperry) or IBM database management
systems(circa 1970) and you'll learn the problems and solutions that all
database systems will encounter and how these problems can be addressed,
b) Read Ivan Sutherland's master's thesis on SKETCHPAD (1980 MIT) and you'll
learn about the roots of object-oriented programming and read about a system
that has only recently been duplicated in commercial software,
c) Read the Bell Systems Technical Journal July-August 1978 issue and you'll see
the presentation of the ideas that created Unix and that proved to be a
revolution in computing - a separate vein paralleling mainframe technology,

In contrast, read the NT  Administrator's manual and you learn something that
will last until the GUI is revised. Of course, you'll make a living. But you'll
still be the same dumb dud that you were when you opened the book. (Note that
this could change were Microsoft were to reveal the internals of their operating
system).

IMHO "they" (the Unix people) have a different value system than you do. I think
it boils down to the question: do you simply want to make a living or do you
wish also to engage your intellect in an extended, pleasant and challenging
conversation?

My own answer is that, if effort must be expended, then it should be expended on
something that enlightens my mind while filling my wallet.






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

Date: Sat, 11 Jul 1998 23:35:34 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: How can you encrypt a CGI script on a server so it will not get "stolen"?
Message-Id: <35a7f489.57840230@nntp.idsonline.com>

fl_aggie@thepentagon.com (I R A Aggie) Said this:

>+ Or, if this is a script that is used in CGI implementations, you could
>+ figure out a way to make the code "self destruct" if it is accessed
>+ with an absolutely obscure (so nobody accidentally destroys it)
>+ code... then if your client steals it, you just access the script from
>+ your web browser with the self destruct code and it deletes itself.
>
>It could be done, but it would have to depend security via obscurity:
>no one sitting down and analyzing the code, and seeing what it does.
>It would also depend upon a site with no backup capability. It would
>also depend upon there not being a dozen other copies on a dozen other
>systems.

That's fine, every time they "post it live" it gets deleted.  At this
point, the idea wouldn't be to get rid of their only copy of the
software they've stolen from you, but to make it pretty much useless
for them - if they keep finding a portion of their site is deleting
itself, they'll stop using it.  (of course, they could just modify the
code, if they have anyone with a little perl knowledge, so it stops
deleting itself).

>
>+ I wouldn't suggest this last idea, as it might blow up in your face
>+ somehow.
>
>Probably a violation of the US Computer Crimes Act, 1968 (and as amended),
>not to mention a violation of the Computer Crimes Act of the various
>states.

I don't know that it would fall under any criminal act or not.  I
would think they would have as much chance of prosecuting you for
deleting your script as you would have in suing them in a civil court
for stealing the script from you in the first place.  Obviously, our
wonderful american legal system favors the guy with the bigger wallet,
but I'm assuming neither party in this case is all that big,
financially speaking.

Anyone know anything about Inislaw, DOJ and that whole mess?  I am not
going to say much, because I was dating Danny Caselaro's (spelling?)
sister's nanny when he was writing a book about that bit of software
history.  (if that ain't a tenuous connection, or what?)  He's dead
now.  Don't go there.  ;)




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

Date: Fri, 10 Jul 1998 22:59:34 GMT
From: alex@gossamer-threads.com (Alex Krohn)
Subject: more flock woes..
Message-Id: <35a69b53.14383745@coburg>

Hi,

Thanks for the previous help about the shared locking problem I was
having when opening files for reading.

I'm still having problems with the script though. It works fine 99% of
the time, but I do get reports on high traffic sites that the database
file is still getting corrupted.

Here's the source for the script:

http://www.gossamer-threads.com/scripts/source/jump.cgi.txt

It's not too long (60 lines or so) and has comments.

If anybody can see what I am doing wrong in regards to locking the
file, or if there is a more reliable method of locking, please let me
know. 

Thanks for any help!

Alex


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

Date: 12 Jul 1998 01:58:49 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: new charter and moderator for comp.lang.perl.announce
Message-Id: <6o958p$jft$1@client3.news.psi.net>

Malcolm Hoar (malch@malch.com) wrote on MDCCLXXV September MCMXCIII in
<URL: news:6o84e7$34g$1@nntp1.ba.best.com>:
++ In article <6o0t0n$h3$2@comdyn.comdyn.com.au>, mgjv@comdyn.com.au (Martien Verbruggen) wrote:
++ 
++ >Please. Not that. We'll be inundated with announcements of every CGI
++ >program that is written in Perl. If you must allow commercial posting,
++ >please restrict them to products that have a direct relevance to Perl,
++ >the programming language, or perl, the program, or the perl community.
++ 
++ Agreed.
++ 
++ I am in favor of accepting on-topic commercial announcements. Of course,
++ others are not. So, I suggest that the moderator flag commercial
++ announcements in the Subject line so those who choose to can simply
++ configure their killfile accordingly.


No, that will give rise to the same problems: nitpicking what is
commercial or not. The quality of software or a book is not determined
by the price. 



Abigail
-- 
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
           print+Just (), another (), Perl (), Hacker ();'


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

Date: Sat, 11 Jul 1998 19:12:10 -0700
From: "Edward Villalovoz" <edwardv@jps.net>
Subject: Perl to populate Access 97 database
Message-Id: <35a81bcd.0@blushng.jps.net>

Does anyone know if you can write to an Access 97 database directly from
perl?  If so how.  Thanks.





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

Date: Sat, 11 Jul 1998 18:27:11 -0700
From: "Edward Villalovoz" <edwardv@jps.net>
Subject: Perl to write data to Access database
Message-Id: <35a81142.0@blushng.jps.net>


Does anyone know if you can write to an Access 97 database directly from
perl?  If so how.  Thanks.




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

Date: Sat, 11 Jul 1998 18:02:16 -0700
From: Jesse Rosenberger <jesse@savalas.com>
Subject: PING / Traceroute Perl Script
Message-Id: <35A80B17.9BA9BE17@savalas.com>

I am trying to get a Ping and a Traceroute Perl Script  to work so that
they will output the information as they are recieved (ie nph-file.pl).
Has anyone done this?  So far this is what I have, and this is only for
the Ping Script:

$fqdn = $ENV{'QUERY_STRING'};
$ping_cmd = "/sbin/ping";
$num_times = 4;
@result = `$ping_cmd -c$num_times $fqdn`;

print "Content-type: text/html\n\n";
print "Ping Results For <b>$fqdn</b>:<br>";
print "<br>\n";
print "@result";
exit;

but it prints it all out in one block instead of line-by-line, like the
normal ping output looks, and it also waits till all the pinging is done
before it outputs.   Can anyone help me with this?

Thanks in advance,
Jesse Rosenberger



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

Date: Sat, 11 Jul 1998 22:15:26 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Putting CPAN on a CD:  good or not good?
Message-Id: <comdog-ya02408000R1107982215260001@news.panix.com>
Keywords: from just another new york perl hacker

In article <slrn6qdntt.48g.gabor@localhost.vmunix.com>, gabor@vmunix.com (Gabor) posted:

>In comp.lang.perl.misc, brian d foy <comdog@computerdog.com> wrote :

>#    * they're making money off of this (yes, so was ORA - well, they
>#       had the potential to make money anyway :)
>
>And how many people make money off of using CGI.pm? :)

there's a big difference about creating new software using a library
or package, and just giving away the package unaltered.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>


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

Date: Sat, 11 Jul 1998 16:53:49 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: PUZZLE: make hat, take ham
Message-Id: <35A7FB0D.3C07DCFC@sirius.com>

Tom Christiansen wrote:
> 
> Here's a puzzle for you.
> 
> Take a list of words and produce two sets of matching word pairs such
> that "Xaaa bbbY" and "Yaaa bbbX" are all 4 legal words from that list.
> For example: "make hat" and "take ham".  In other words, you have to
> exchange the first letter of the first word with the last letter of
> the last word.  For example: "make hat" and "take ham" are one set of
> such pairs.
> 
> Now, find all such matching pairs in the list, and do this in better than
> exponential time.  The goal is to run this over a large > /usr/dict/words.

I think the code below works.  I ran it on ispell.words.  It
is fast, but there are a lot of words that meet your criteria.
Here is a sample output line (with just 4 letter words)

b(ids unt lum ide) matches (her lim ver)a

--  Jim Bowlin

use strict;

my @list = qw/take make hat ham dum paul alf self/;

my ($S, $E);

foreach (@list) {
    $$S{substr($_,  0, 1)}{substr($_, 1)}++;
    $$E{substr($_, -1, 1)}{substr($_, 0, -1)}++;
}

my ($x, $y);
for $x ('a' .. 'z') {
    for $y ('a' .. 'z') {
	$x eq $y and next;
	my @list1 = grep $$S{$x}{$_}, keys %{$$S{$y}};
	my @list2 = grep $$E{$x}{$_}, keys %{$$E{$y}};
	@list1 && @list2 or next;
	print "$x(@list1) matches (@list2)$y\n";
    }
}

__END__


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

Date: 12 Jul 1998 00:54:36 GMT
From: d-lewart@uiuc.edu (Daniel S. Lewart)
Subject: Re: PUZZLE: make hat, take ham
Message-Id: <6o91gc$2a8$1@vixen.cso.uiuc.edu>

Tom Christiansen <tchrist@mox.perl.com> writes:

> Now, find all such matching pairs in the list, and do this in better than
> exponential time.  The goal is to run this over a large /usr/dict/words.

Below is a solution for you.  Let N be the number of words.  Empirically,
there are O(N**4) matching pairs and my solution takes O(N**3) time.

Hoping for better solutions,
Daniel Lewart
d-lewart@uiuc.edu
-------------------------------------------------------------------------------
#!/usr/bin/perl -w

use strict;

my (%aaax, %h, %xaaa, %ybbb);
while (<>) {
    chomp;
    next unless /^([a-z])([a-z]*)([a-z])$/;
    my ($X, $aaa, $bbb, $Y) = ($1, "$2$3", "$1$2", $3);
    $h{$_} = 1;
    push @{$aaax{$aaa}}, $X;
    push @{$xaaa{$X}}, $aaa;
    push @{$ybbb{$Y}}, $bbb;
}

foreach my $X (sort keys %xaaa) {
    foreach my $aaa (@{$xaaa{$X}}) {
	foreach my $Y (@{$aaax{$aaa}}) {
	    next if $Y le $X;
	    foreach my $bbb (@{$ybbb{$Y}}) {
		print "$X$aaa $bbb$Y, $Y$aaa $bbb$X\n" if $h{"$bbb$X"};
	    }
	}
    }
}
-------------------------------------------------------------------------------


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

Date: 11 Jul 1998 15:09:34 GMT
From: Frampton Steve R <3srf@qlink.queensu.ca>
Subject: REPOST: Re: I am an "antispam spammer"?
Message-Id: <REPOST-8007.75561523438.6o7v7e$ovu$1@knot.queensu.ca>

In news.admin.net-abuse.email Bob Trieger <sowmaster@juicepigs.com> wrote:
: I think it is even ruder than the morons with munged addresses. They are so 
: stupid they don't have a clue that they are being rude.

Excuse me, but this just pisses me off.  Just who the fuck are *you* to
dictate what a person may do with their private resources?  If somebody
mungs their address, and you don't like it, then *DON'T SEND THEM ANY
FUCKING E-MAIL*.  Answering a question for somebody is supposed to be an
act of altruism.  If you're so altruistic, then I'm sure taking the extra
30 seconds to de-mung isn't such a big deal.  If not, then why are you
bothering to respond?  (Perhaps it is to inflate your ego by
demonstrating your indepth knowledge of the topic being discussed)

Munging is an effective way of thwarting spam.  Trust me, I know because I
use to be spammed from hell to highwater -- but after munging for about a
year or so, my spam count dropped to only 1 or 2 a day.  I'm an end-user
at a captive ISP -- a University -- they don't support filtering, they
don't support procmail, etc.  (No, I'm not allowed to install filtering
software nor procmail.  In addition, I have a 2 MB disk quota so the point
is moot, anyway.  No, I will not install end-client software.  I read my
e-mail on the server with Pine by *choice*).  In this case, munging was a
quick-and-easy solution for me.

P.S. I no longer mung -- as a result, my spam count is *way* up.  Was it
because of morons like you flaming me for it?  Nope!  The reason I no
longer mung is because I decided I wanted to get righteous and LART every
spam that comes my way.  But I *used* to mung, and completely understand
the point of view, and support the rights of those who choose to do so.
It makes things a bit more inconvenient for me, but I take comfort in
knowing that it makes things a bit more inconvenient for spammers as well.

Follow-ups set.  This has *NOTHING* to do with Perl.

--------------< LINUX: The choice of a GNU generation. >--------------
Steve Frampton  <3srf@qlink.queensu.ca>  http://qlink.queensu.ca/~3srf
========= WAS CANCELLED BY =======:
Path: ...!newshub.northeast.verio.net!cpk-news-hub1.bbnplanet.com!dallas-news-feed1.bbnplanet.com!news.bbnplanet.com!news.internetoffice.com!nntp.HipCrime.new!cyberspam!hipcancel!usenet
From: HipCrime@wajbyjrce.net
Newsgroups: news.admin.net-abuse.email,misc.test
Subject: cmsg cancel <6o7v7e$ovu$1@knot.queensu.ca>
Control: cancel <6o7v7e$ovu$1@knot.queensu.ca>
Date: 11 Jul 1998 23:19:12 GMT
Organization: HipCrime International, unLtd.
Lines: 2
Sender: Frampton Steve R <3srf@qlink.queensu.ca>
Approved: HipCrime@wajbyjrce.net
Message-ID: <cancel.6o7v7e$ovu$1@knot.queensu.ca>
NNTP-Posting-Host: port156.pitt.prodigy.net
X-No-Archive: Yes

Cancelled by HipCrime's NewsAgent.



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

Date: Thu, 09 Jul 1998 02:19:43 GMT
From: Rishi Bhattacharya <rishi@webresource.net>
Subject: Webresource.net
Message-Id: <359900F1.76254387@webresource.net>

Greetings,

Webresource.net is a new professional web site devoted to
archiving and sharing a complete set of resources for web
developers. It's divided into convenient sections (HTML,
Graphics, VRML, CGI, Java, JavaScript, etc.), each
containing a thorough and carefully selected library of
articles, resources, consulting services, and tutorials to
assist web developers of all ranges of skill.

Webresource.net is constantly updated. Each week, our
department heads present new articles covering a topic
relevant to their area. Our consultants are also happy to
assist readers with their questions about HTML, CGI, Java, or 
any other web development issues. In addition, Webresource.net was
recently awarded the cool resource award by developer.com.

We invite you to visit the site at
http://www.webresource.net/

Regards,

----
Rishi Bhattacharya
Electrical Engineer 
NASA/Lockheed Martin


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

Date: Sun, 12 Jul 1998 01:34:27 GMT
From: techsoft@abcpages.com (Alex Kovalenko)
Subject: Willing to pay for script..
Message-Id: <35a811a5.5791614@news.sprint.ca>

Hi! We are looking for a script which will do the matchmaking.. here
is what we want from it:

1) User enters keyword(s)
2) Perl program search through files with messages
3) if find the keyword in file, transfer it into text format, and add
itself to a file
4) and so far till the end. get the file and send it to user.
5) do this things every day by using cron.

If you are willing to help to create such a script or can give some
advices etc, we would be very glad and probably can pay you a
reasonable money.

Regards,
Alex. 

P.S. Try to response asap with crossposting to my e-mail.. Regards


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

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

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